signals_core 7.0.0 copy "signals_core: ^7.0.0" to clipboard
signals_core: ^7.0.0 copied to clipboard

The signals library exposes four core functions which are the building blocks to model any business logic you can think of.

7.0.0 #

⚠️ BREAKING CHANGES #

  • FutureSignal Direct AsyncSignal Base: FutureSignal no longer extends StreamSignal or supports stream-specific properties/methods. It now inherits directly from AsyncSignal to optimize future-based execution and eliminate stream event sink and subscription overhead.
  • Signal Options Encapsulation: Removed individual configuration named parameters (e.g. autoDispose, debugLabel / name) from all constructor signatures and global creator helper functions across signals_core. They must now be configured inside specific Options classes (e.g. SignalOptions, ListSignalOptions, AsyncSignalOptions, etc.).
  • debugLabel Deprecation: The debugLabel parameter has been deprecated across all constructors and creator methods. Use the name parameter inside their corresponding Options configuration objects to align with Preact/JS Signals options standards.

🚀 New Features #

  • Issue #433 Resolution: Resolved a double-triggering issue where awaiting a future signal re-executed the future callback a second time upon completion. Done by isolating context tracking and filtering out isLoading -> completed transitions.
  • Colocated Options Classes: Introduced highly modular options classes tailored for each domain (including ListSignalOptions, SetSignalOptions, IterableSignalOptions, ChangeSignalOptions, AsyncSignalOptions, and PersistedSignalOptions).
  • Readonly Options Getter: Added toSignalOptions on ReadonlySignalOptions to easily convert read-only signal configurations to writable signal configurations.
  • Writable Computed Signals (linkedSignal / linkedSignalOptions): Implementation of Angular-style writable computed signals.
  • Value Semantics: Added custom copyWith, operator ==, and hashCode overrides across all signals options classes for complete value semantics and immutable comparisons.
  • Doubly-Linked Node Traversals: Enhanced DevToolsSignalsObserver to traverse doubly-linked list nodes.

6.3.1 #

  • REFACTOR: migrate signal mixins to mixin classes.
  • REFACTOR: Rename persisted signal classes to correct typo.
  • REFACTOR: Formatting.
  • REFACTOR: allow setting a signal value inside computed.
  • REFACTOR: inline signal subscribe.
  • REFACTOR: share peek() between signal/computed.
  • REFACTOR: inline cycle detection.
  • REFACTOR: use untracked for signal subscribe.
  • FIX: map.remove - only notify when value was removed.
  • FIX(signals): accessing cached SignalContainer in Effect cause loop.
  • FIX(signals): accessing cached SignalContainer in Effect cause loop.
  • FIX: untracked always reset evaluation context.
  • FIX: #179 and add overrideWith.
  • FIX: #175 - add missing autoDispose/equality on signals.
  • FIX: https://github.com/rodydavis/signals.dart/issues/156.
  • FEAT: Impl loading for state reloading and refreshing classes.
  • FEAT: Improve async state.
  • FEAT: Changed Async{Loading,Data,Error} to be const.
  • FEAT: Better type safety on Connect.
  • DOCS: rename _computed => _fn.
  • DOCS: rename some internal API methods.

6.2.1 #

  • Replace benchmark with dart-reactivity-benchmark
  • Bump preact_signals to 1.9.4

6.2.0 #

  • Adding SignalsAutoDisposeMixin
  • Computed/Signal now use SignalsAutoDisposeMixin but ReadonlySignalMixin no longer has dispose methods
  • Tests now check for SignalEffectException and not error
  • Exposing SignalEffectException from preact_signals
  • Bump preact_signals to 1.9.3
  • Computed not also can throw SignalEffectException instead of generic error

6.1.0 #

  • Fix error in effect not showing StackTrace
  • Add extensions for List, Map, Set, Iterable, bool, String, int, double, num, Comparable, Pattern, Enum
  • Add persisted signals for bool, double, Enum, int, num, String and Json (including nullable for each)
  • Add SignalsKeyValueStore and SignalsInMemoryKeyValueStore for storage
  • Add $ extension method for common types to create signal and function for computed
Signal<int> count = 0.$;
Computed<double> doubleValue => (() => count() * 2).$;
Signal<String> name = 'Flutter'.$;
Signal<bool> isTrue = true.$;
Signal<Brightness> brightness = Brightness.light.$;
Signal<double> progress = 0.5.$;
  • Add SignalEffectException for getting the error and StackTrace for a failed effect callback

6.0.2 #

  • Fix cycle error with TrackedSignalMixin and Computed
  • Add AsyncErrorReloading, AsyncErrorRefreshing, AsyncDataReloading, AsyncDataRefreshing

6.0.1 #

  • Fix issue with StreamSignal _stream not initialized

6.0.0 #

  • Switching to preact_signals package for core implementation
  • Removing old deprecated methods
  • Add new mixins: EventSinkSignalMixin, SinkSignalMixin, StreamSignalMixin, SetSignalMixin, ListSignalMixin, MapSignalMixin, QueueSignalMixin, ChangeStackSignalMixin, IterableSignalMixin
  • Update AsyncSignal to implement EventSink
  • Removing previous/initial value from Signal and Computed in favor of TrackedSignal, TrackedSignalMixin and trackedSignal()
  • Update SignalsObserver to include value for signal created (instead of peek())
  • Updated examples
  • Remove callback to signal
  • Remove toSignal extension method (causing unintended casts) in favor of .$ for Object/Object?

5.5.0 #

  • Fix for hot reload
  • Removing deprecation warning for watch/unwatch

5.4.0 #

5.3.0 #

  • Add Signal.lazy and lazySignal
  • Add signal.isLazy and computed.isLazy
  • Add await future to refresh/reload for FutureSignal

5.2.3 #

5.2.2 #

5.2.0 #

5.1.0 #

  • Sync core implementation with @preactjs/signals package
  • Allow mutations in computed
  • Share peek implementation for signal/computed
  • Inline various methods for performance

5.0.1 #

  • Switching SignalsObserver to use log instead of print
  • Only setting SignalsObserver to use DevToolsSignalsObserver in kDebugMode

5.0.0 #

  • Adding previousValue/initialValue to Signal
  • Removing SignalEquality
  • Deprecating ValueSignal in favor of Signal
  • Deprecating .forceUpdate in favor of .set(..., force: true)
  • Removing old deprecated methods
  • Adding more inline code documentation
  • ListSignal/SetSignal now extends IterableSignal
  • Fixing ChangeStackSignal getters for history/redos to return an iterable list
  • Fixing async signal isCompleted race condition

4.5.0 #

  • Updating documentation comments
  • Fixing signals observer bug on effect
  • Removing previousValue from value signal
  • Add ability to remove an onDispose callback

4.4.0 #

  • adding overrideWith
  • fix autoDispose not passed in for some signals
  • fix equality not being passed in for some signals
  • fix for completed not being reset on async signal

4.2.1 #

4.2.0 #

4.1.0 #

  • Fix bug in auto dispose where signal dispose causes cycle
  • Dispose does not reset to initial value and will read the last value with a warning

4.0.3 #

  • Removing SignalsReadAfterDisposeError in favor of debug print warning

4.0.1 #

  • Adding SignalsWriteAfterDisposeError/SignalsReadAfterDisposeError for better error handling

4.0.0 #

  • StreamSignal now will rebuild with signals are read in the callback to create the stream
  • Stream/Future signal both can take an optional list of dependencies to rebuild on
  • FutureSignal now extends StreamSignal
  • StreamSignal can now rebuild/refresh
  • StreamSignal can now pause/resume
  • Adding computedAsync/computedFrom for similar API to angular
  • Adding .set(..., force: true) to Signal/Computed to force a rebuild
  • Adding .recompute() for Computed to recall the callback
  • Adding autoDispose for Signal/Computed

3.0.0 #

  • adding readonlySignalContainer to be existing signalContainer API
  • updating signalContainer to allow for mutable signals
  • adding SignalEquality to allow override of ==
  • adding select for signals to return a computed value
  • fix memory leak on signal container
  • adding ChangeStackSignal

1.0.6 #

  • Adding onDone for passed stream in StreamSignal

1.0.5 #

  • Adding SignalContainer remove and adding Signal generic

1.0.4 #

  • Adding SignalContainer/signalContainer to create signals with args

1.0.3 #

  • Adding dispose for FutureSignal, StreamSignal and AsyncSignal

1.0.2 #

  • Adding dispose methods for signal, computed and effect
  • Adding initialValue getter for signal and computed

1.0.1 #

  • Exposing reloadSignalsDevTools for hot reload support

1.0.0 #

  • Moving core api from signals package to signals_core package
11
likes
150
points
24.6k
downloads

Documentation

Documentation
API reference

Publisher

verified publisherrodydavis.com

Weekly Downloads

The signals library exposes four core functions which are the building blocks to model any business logic you can think of.

Homepage
Repository (GitHub)
View/report issues

Topics

#signal #reactive #state #signals #rx

License

Apache-2.0 (license)

Dependencies

meta, preact_signals

More

Packages that depend on signals_core