Skip to content

Commit

Permalink
v0.42.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jinyus committed Mar 10, 2024
1 parent c9dac1a commit e3b3816
Show file tree
Hide file tree
Showing 14 changed files with 88 additions and 81 deletions.
6 changes: 3 additions & 3 deletions examples/auth_flow/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -211,15 +211,15 @@ packages:
path: "../../packages/state_beacon"
relative: true
source: path
version: "0.41.3"
version: "0.42.0"
state_beacon_core:
dependency: transitive
description:
name: state_beacon_core
sha256: "820d92d2eb1d958fb19bbbf067400be658eb449b299965ea3a7b8f4eff216f93"
sha256: "9ae6bc74f624c4fa37af885f2bbb3278dcd503c2397aa2b70752b28426c25f40"
url: "https://pub.dev"
source: hosted
version: "0.41.2"
version: "0.42.0"
stream_channel:
dependency: transitive
description:
Expand Down
6 changes: 3 additions & 3 deletions examples/counter/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,15 @@ packages:
path: "../../packages/state_beacon"
relative: true
source: path
version: "0.41.3"
version: "0.42.0"
state_beacon_core:
dependency: transitive
description:
name: state_beacon_core
sha256: "820d92d2eb1d958fb19bbbf067400be658eb449b299965ea3a7b8f4eff216f93"
sha256: "9ae6bc74f624c4fa37af885f2bbb3278dcd503c2397aa2b70752b28426c25f40"
url: "https://pub.dev"
source: hosted
version: "0.41.2"
version: "0.42.0"
stream_channel:
dependency: transitive
description:
Expand Down
6 changes: 3 additions & 3 deletions examples/flutter_main/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -414,15 +414,15 @@ packages:
path: "../../packages/state_beacon"
relative: true
source: path
version: "0.41.3"
version: "0.42.0"
state_beacon_core:
dependency: transitive
description:
name: state_beacon_core
sha256: "820d92d2eb1d958fb19bbbf067400be658eb449b299965ea3a7b8f4eff216f93"
sha256: "9ae6bc74f624c4fa37af885f2bbb3278dcd503c2397aa2b70752b28426c25f40"
url: "https://pub.dev"
source: hosted
version: "0.41.2"
version: "0.42.0"
state_beacon_lint:
dependency: "direct dev"
description:
Expand Down
6 changes: 3 additions & 3 deletions examples/shopping_cart/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -211,15 +211,15 @@ packages:
path: "../../packages/state_beacon"
relative: true
source: path
version: "0.41.3"
version: "0.42.0"
state_beacon_core:
dependency: transitive
description:
name: state_beacon_core
sha256: "820d92d2eb1d958fb19bbbf067400be658eb449b299965ea3a7b8f4eff216f93"
sha256: "9ae6bc74f624c4fa37af885f2bbb3278dcd503c2397aa2b70752b28426c25f40"
url: "https://pub.dev"
source: hosted
version: "0.41.2"
version: "0.42.0"
stream_channel:
dependency: transitive
description:
Expand Down
6 changes: 3 additions & 3 deletions examples/skeleton/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,15 @@ packages:
path: "../../packages/state_beacon"
relative: true
source: path
version: "0.41.3"
version: "0.42.0"
state_beacon_core:
dependency: transitive
description:
name: state_beacon_core
sha256: "820d92d2eb1d958fb19bbbf067400be658eb449b299965ea3a7b8f4eff216f93"
sha256: "9ae6bc74f624c4fa37af885f2bbb3278dcd503c2397aa2b70752b28426c25f40"
url: "https://pub.dev"
source: hosted
version: "0.41.2"
version: "0.42.0"
stream_channel:
dependency: transitive
description:
Expand Down
6 changes: 3 additions & 3 deletions examples/vgv_best_practices/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -203,15 +203,15 @@ packages:
path: "../../packages/state_beacon"
relative: true
source: path
version: "0.41.3"
version: "0.42.0"
state_beacon_core:
dependency: transitive
description:
name: state_beacon_core
sha256: "820d92d2eb1d958fb19bbbf067400be658eb449b299965ea3a7b8f4eff216f93"
sha256: "9ae6bc74f624c4fa37af885f2bbb3278dcd503c2397aa2b70752b28426c25f40"
url: "https://pub.dev"
source: hosted
version: "0.41.2"
version: "0.42.0"
stream_channel:
dependency: transitive
description:
Expand Down
4 changes: 4 additions & 0 deletions packages/state_beacon/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.42.0

- [Breaking] `resetIfError` option for `toFuture()` is now `true` by default. This was done because there's rarely a case where you'd want it to throw instantly. If you want to keep the previous value, set `resetIfError` to `false`.

# 0.41.3

- [Docs] Update README
Expand Down
56 changes: 28 additions & 28 deletions packages/state_beacon/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<img src="https://img.shields.io/badge/license-MIT-purple">
<a href="https://app.codecov.io/github/jinyus/dart_beacon"><img src="https://img.shields.io/codecov/c/github/jinyus/dart_beacon"></a>
<a href="https://pub.dev/packages/state_beacon"><img src="https://img.shields.io/pub/points/state_beacon?color=blue"></a>
<img alt="stars" src="https://img.shields.io/github/stars/jinyus/dart_beacon?style=social"/>
</p>

## Overview
Expand Down Expand Up @@ -95,14 +96,13 @@ NB: Create the file if it doesn't exist.
## Features
- [Beacon.writable](#beaconwritable): Mutable beacon that allows both reading and writing.
- [Beacon.scopedWritable](#beaconscopedwritable): Returns a `ReadableBeacon` and a function for setting its value.
- [Beacon.readable](#beaconreadable): Immutable beacon that only emit values, ideal for readonly data.
- [Beacon.derived](#beaconderived): Derive values from other beacons, keeping them reactively in sync.
- [Beacon.effect](#beaconeffect): React to changes in beacon values.
- [BeaconScheduler](#beaconscheduler): Configure the scheduler for all beacons.
- [Beacon.derived](#beaconderived): Derive values from other beacons, keeping them reactively in sync.
- [Beacon.future](#beaconfuture): Derive values from asynchronous operations, managing state during computation.
- [Properties](#properties): Properties for `FutureBeacons`.
- [Methods](#methods): Methods available for `FutureBeacons`.
- [Properties](#properties)
- [Methods](#methods)
- [Beacon.stream](#beaconstream): Create derived beacons from Dart streams. values are wrapped in an `AsyncValue`.
- [Beacon.streamRaw](#beaconstreamraw): Like `Beacon.stream`, but it doesn't wrap the value in an `AsyncValue`.
- [Beacon.debounced](#beacondebounced): Delay value updates until a specified time has elapsed, preventing rapid or unwanted updates.
Expand All @@ -113,8 +113,8 @@ NB: Create the file if it doesn't exist.
- [Beacon.bufferedCount](#beaconbufferedcount): Create a buffer/list of values based an `int` limit.
- [Beacon.bufferedTime](#beaconbufferedtime): Create a buffer/list of values based on a time limit.
- [Beacon.list](#beaconlist): Manage reactive lists that automatically update dependent beacons upon changes.
- [Beacon.hashSet](#beaconhashset): Like Beacon.list, but for Sets.
- [Beacon.hashMap](#beaconhashmap): Like Beacon.list, but for Maps.
- [Beacon.hashSet](#beaconhashset)
- [Beacon.hashMap](#beaconhashmap)
- [AsyncValue](#asyncvalue): A wrapper around a value that can be in one of four states: `idle`, `loading`, `data`, or `error`.
- [unwrap](#asyncvalueunwrap): Casts this [AsyncValue] to [AsyncData] and return its value.
- [lastData](#asyncvaluelastdata): Returns the latest valid data value or null.
Expand All @@ -123,24 +123,24 @@ NB: Create the file if it doesn't exist.
- [Beacon.family](#beaconfamily): Create and manage a family of related beacons.
- [BeaconGroup](#beacongroup): Create, reset and dispose and group of beacons.
- [Methods](#properties-and-methods): Additional methods for beacons that can be chained.
- [subscribe](#mybeaconsubscribe): Subscribes to the beacon and listens for changes to its value.
- [stream](#mybeaconstream): Obtain a stream from a beacon, enabling integration with stream-based APIs and libraries.
- [wrap](#mywritablewrapanybeacon): Wraps an existing beacon and consumes its values
- [ingest](#mywritableingestanystream): Wraps any stream and consumes its values
- [next](#mybeaconnext): Allows awaiting the next value as a future.
- [toListenable](#mybeacontolistenable): Returns a `ValueListenable` that emits the beacon's value whenever it changes.
- [toValueNotifier](#mybeacontovaluenotifier): Returns a `ValueNotifier` that emits the beacon's value whenever it changes.
- [dispose](#mybeacondispose): Disposes the beacon and releases all resources.
- [onDispose](#mybeaconondispose): Registers a callback to be called when the beacon is disposed.
- [Chaining Beacons](#chaining-methods): Seamlessly chain beacons to create sophisticated reactive pipelines, combining multiple functionalities for advanced value manipulation and control.
- [buffer](#mybeaconbuffer): Returns a [Beacon.bufferedCount](#beaconbufferedcount) that wraps this beacon.
- [bufferTime](#mybeaconbuffertime): Returns a [Beacon.bufferedTime](#beaconbufferedtime) that wraps this beacon.
- [throttle](#mybeaconthrottle): Returns a [Beacon.throttled](#beaconthrottled) that wraps this beacon.
- [filter](#mybeaconfilter): Returns a [Beacon.filtered](#beaconfiltered) that wraps this beacon.
- [map](#mybeaconmap): Returns a [Beacon.readable] that wraps a beacon and transform its values.
- [debounce](#mybeacondebounce): Returns a [Beacon.debounced](#beacondebounced) that wraps this beacon.
- [Debugging](#debugging): Facilities for debugging and observing beacons.
- [Disposal](#disposal): Disposing beacons and effects.
- [subscribe()](#mybeaconsubscribe)
- [tostream()](#mybeacontostream)
- [wrap()](#mywritablewrapanybeacon)
- [ingest()](#mywritableingestanystream)
- [next()](#mybeaconnext)
- [toListenable()](#mybeacontolistenable)
- [toValueNotifier()](#mybeacontovaluenotifier)
- [dispose()](#mybeacondispose)
- [onDispose()](#mybeaconondispose)
- [Chaining Beacons](#chaining-methods): Seamlessly chain beacons to create sophisticated reactive pipelines, combining multiple functionalities for advanced value manipulation and control.
- [buffer](#mybeaconbuffer)
- [bufferTime](#mybeaconbuffertime)
- [throttle](#mybeaconthrottle)
- [filter](#mybeaconfilter)
- [map](#mybeaconmap)
- [debounce](#mybeacondebounce)
- [Debugging](#debugging)
- [Disposal](#disposal)
- [Testing](#testing)
- [BeaconController](#beaconcontroller)
- [Dependency Injection](#dependency-injection)
Expand Down Expand Up @@ -185,7 +185,7 @@ ReadableBeacon<int> get counter => _internalCounter;

### Beacon.derived:

A `DerivedBeacon` is composed of other beacons. It automatically tracks any beacons accessed within it's closure and will recompute its value when one of them changes.
A `DerivedBeacon` is composed of other beacons. It automatically tracks any beacons accessed within its closure and will recompute its value when one of them changes.

These beacons are lazy and will only compute their value when accessed, subscribed to or being watched by a widget or an [effect](#beaconeffect).

Expand Down Expand Up @@ -1132,12 +1132,12 @@ expect(c.isDisposed, true);

## Testing

Beacons can expose a `Stream` with the `.stream` getter. This can be used to test the state of a beacon over time with existing `StreamMatcher`s.
Beacons can expose a `Stream` with the `.toStream()` method. This can be used to test the state of a beacon over time with existing `StreamMatcher`s.

```dart
final count = Beacon.writable(10);
final stream = count.stream;
final stream = count.toStream();
Future.delayed(Duration(milliseconds: 1), () => count.value = 20);
Expand Down Expand Up @@ -1199,7 +1199,7 @@ class CountController extends BeaconController {

## Dependency Injection

Dependency injection refers to the process of providing an instance of a beacon or BeaconController to your widgets. `state_beacon` ships with a lightweight dependency injection library called [lite_ref](https://pub.dev/packages/lite_ref) that makes it easy and ergonomic to provide Beacons and BeaconControllers to your widgets. It also manages disposal of both.
Dependency injection refers to the process of providing an instance of a Beacon or BeaconController to your widgets. `state_beacon` ships with a lightweight dependency injection library called [lite_ref](https://pub.dev/packages/lite_ref) that makes it easy and ergonomic to provide Beacons and BeaconControllers to your widgets. It also manages disposal of both.

NB: You can use another DI library such as `Provider`.

Expand Down
4 changes: 2 additions & 2 deletions packages/state_beacon/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: state_beacon
description: A reactive primitive and simple state managerment solution for dart and flutter
version: 0.41.3
version: 0.42.0
repository: https://github.com/jinyus/dart_beacon

environment:
Expand All @@ -11,7 +11,7 @@ dependencies:
flutter:
sdk: flutter
lite_ref: ^0.5.2
state_beacon_core: ^0.41.2
state_beacon_core: ^0.42.0

dev_dependencies:
flutter_lints: ^3.0.0
Expand Down
4 changes: 4 additions & 0 deletions packages/state_beacon_core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.42.0

- [Breaking] `resetIfError` option for `toFuture()` is now `true` by default. This was done because there's rarely a case where you'd want it to throw instantly. If you want to keep the previous value, set `resetIfError` to `false`.

# 0.41.2

- [Docs] Update README
Expand Down
55 changes: 27 additions & 28 deletions packages/state_beacon_core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,13 @@ NB: Create the file if it doesn't exist.
## Features
- [Beacon.writable](#beaconwritable): Mutable beacon that allows both reading and writing.
- [Beacon.scopedWritable](#beaconscopedwritable): Returns a `ReadableBeacon` and a function for setting its value.
- [Beacon.readable](#beaconreadable): Immutable beacon that only emit values, ideal for readonly data.
- [Beacon.derived](#beaconderived): Derive values from other beacons, keeping them reactively in sync.
- [Beacon.effect](#beaconeffect): React to changes in beacon values.
- [BeaconScheduler](#beaconscheduler): Configure the scheduler for all beacons.
- [Beacon.derived](#beaconderived): Derive values from other beacons, keeping them reactively in sync.
- [Beacon.future](#beaconfuture): Derive values from asynchronous operations, managing state during computation.
- [Properties](#properties): Properties for `FutureBeacons`.
- [Methods](#methods): Methods available for `FutureBeacons`.
- [Properties](#properties)
- [Methods](#methods)
- [Beacon.stream](#beaconstream): Create derived beacons from Dart streams. values are wrapped in an `AsyncValue`.
- [Beacon.streamRaw](#beaconstreamraw): Like `Beacon.stream`, but it doesn't wrap the value in an `AsyncValue`.
- [Beacon.debounced](#beacondebounced): Delay value updates until a specified time has elapsed, preventing rapid or unwanted updates.
Expand All @@ -114,8 +113,8 @@ NB: Create the file if it doesn't exist.
- [Beacon.bufferedCount](#beaconbufferedcount): Create a buffer/list of values based an `int` limit.
- [Beacon.bufferedTime](#beaconbufferedtime): Create a buffer/list of values based on a time limit.
- [Beacon.list](#beaconlist): Manage reactive lists that automatically update dependent beacons upon changes.
- [Beacon.hashSet](#beaconhashset): Like Beacon.list, but for Sets.
- [Beacon.hashMap](#beaconhashmap): Like Beacon.list, but for Maps.
- [Beacon.hashSet](#beaconhashset)
- [Beacon.hashMap](#beaconhashmap)
- [AsyncValue](#asyncvalue): A wrapper around a value that can be in one of four states: `idle`, `loading`, `data`, or `error`.
- [unwrap](#asyncvalueunwrap): Casts this [AsyncValue] to [AsyncData] and return its value.
- [lastData](#asyncvaluelastdata): Returns the latest valid data value or null.
Expand All @@ -124,24 +123,24 @@ NB: Create the file if it doesn't exist.
- [Beacon.family](#beaconfamily): Create and manage a family of related beacons.
- [BeaconGroup](#beacongroup): Create, reset and dispose and group of beacons.
- [Methods](#properties-and-methods): Additional methods for beacons that can be chained.
- [subscribe](#mybeaconsubscribe): Subscribes to the beacon and listens for changes to its value.
- [stream](#mybeaconstream): Obtain a stream from a beacon, enabling integration with stream-based APIs and libraries.
- [wrap](#mywritablewrapanybeacon): Wraps an existing beacon and consumes its values
- [ingest](#mywritableingestanystream): Wraps any stream and consumes its values
- [next](#mybeaconnext): Allows awaiting the next value as a future.
- [toListenable](#mybeacontolistenable): Returns a `ValueListenable` that emits the beacon's value whenever it changes.
- [toValueNotifier](#mybeacontovaluenotifier): Returns a `ValueNotifier` that emits the beacon's value whenever it changes.
- [dispose](#mybeacondispose): Disposes the beacon and releases all resources.
- [onDispose](#mybeaconondispose): Registers a callback to be called when the beacon is disposed.
- [Chaining Beacons](#chaining-methods): Seamlessly chain beacons to create sophisticated reactive pipelines, combining multiple functionalities for advanced value manipulation and control.
- [buffer](#mybeaconbuffer): Returns a [Beacon.bufferedCount](#beaconbufferedcount) that wraps this beacon.
- [bufferTime](#mybeaconbuffertime): Returns a [Beacon.bufferedTime](#beaconbufferedtime) that wraps this beacon.
- [throttle](#mybeaconthrottle): Returns a [Beacon.throttled](#beaconthrottled) that wraps this beacon.
- [filter](#mybeaconfilter): Returns a [Beacon.filtered](#beaconfiltered) that wraps this beacon.
- [map](#mybeaconmap): Returns a [Beacon.readable] that wraps a beacon and transform its values.
- [debounce](#mybeacondebounce): Returns a [Beacon.debounced](#beacondebounced) that wraps this beacon.
- [Debugging](#debugging): Facilities for debugging and observing beacons.
- [Disposal](#disposal): Disposing beacons and effects.
- [subscribe()](#mybeaconsubscribe)
- [tostream()](#mybeacontostream)
- [wrap()](#mywritablewrapanybeacon)
- [ingest()](#mywritableingestanystream)
- [next()](#mybeaconnext)
- [toListenable()](#mybeacontolistenable)
- [toValueNotifier()](#mybeacontovaluenotifier)
- [dispose()](#mybeacondispose)
- [onDispose()](#mybeaconondispose)
- [Chaining Beacons](#chaining-methods): Seamlessly chain beacons to create sophisticated reactive pipelines, combining multiple functionalities for advanced value manipulation and control.
- [buffer](#mybeaconbuffer)
- [bufferTime](#mybeaconbuffertime)
- [throttle](#mybeaconthrottle)
- [filter](#mybeaconfilter)
- [map](#mybeaconmap)
- [debounce](#mybeacondebounce)
- [Debugging](#debugging)
- [Disposal](#disposal)
- [Testing](#testing)
- [BeaconController](#beaconcontroller)
- [Dependency Injection](#dependency-injection)
Expand Down Expand Up @@ -186,7 +185,7 @@ ReadableBeacon<int> get counter => _internalCounter;

### Beacon.derived:

A `DerivedBeacon` is composed of other beacons. It automatically tracks any beacons accessed within it's closure and will recompute its value when one of them changes.
A `DerivedBeacon` is composed of other beacons. It automatically tracks any beacons accessed within its closure and will recompute its value when one of them changes.

These beacons are lazy and will only compute their value when accessed, subscribed to or being watched by a widget or an [effect](#beaconeffect).

Expand Down Expand Up @@ -1133,12 +1132,12 @@ expect(c.isDisposed, true);

## Testing

Beacons can expose a `Stream` with the `.stream` getter. This can be used to test the state of a beacon over time with existing `StreamMatcher`s.
Beacons can expose a `Stream` with the `.toStream()` method. This can be used to test the state of a beacon over time with existing `StreamMatcher`s.

```dart
final count = Beacon.writable(10);
final stream = count.stream;
final stream = count.toStream();
Future.delayed(Duration(milliseconds: 1), () => count.value = 20);
Expand Down Expand Up @@ -1200,7 +1199,7 @@ class CountController extends BeaconController {

## Dependency Injection

Dependency injection refers to the process of providing an instance of a beacon or BeaconController to your widgets. `state_beacon` ships with a lightweight dependency injection library called [lite_ref](https://pub.dev/packages/lite_ref) that makes it easy and ergonomic to provide Beacons and BeaconControllers to your widgets. It also manages disposal of both.
Dependency injection refers to the process of providing an instance of a Beacon or BeaconController to your widgets. `state_beacon` ships with a lightweight dependency injection library called [lite_ref](https://pub.dev/packages/lite_ref) that makes it easy and ergonomic to provide Beacons and BeaconControllers to your widgets. It also manages disposal of both.

NB: You can use another DI library such as `Provider`.

Expand Down
Loading

0 comments on commit e3b3816

Please sign in to comment.