noir_signals 0.0.1-alpha.0
noir_signals: ^0.0.1-alpha.0 copied to clipboard
Reusable lifecycle hooks and Signals reactive state for Noir, the Flutter-like terminal UI framework for Dart.
Changelog #
0.0.1-alpha.0 #
First prerelease of the optional companion package for Noir.
Added #
- Added the widget lifecycle hook runtime and the built-in hooks, moved
from Noir's
package:noir/hooks.dartlibrary:SignalWidget,SignalBuilder,Hook,HookState,use,useContext,useTickerProvider, the state and effect primitives, the listenable and asynchronous hooks, and the controller and animation hooks. The hosts are renamed fromHookWidgetandHookBuilder;HookWidgetBuilderbecomesSignalWidgetBuilder. Hook functions, return types, and lifecycle rules are unchanged.useStatereturns aValueNotifieranduseTextEditingControllerreturns aTextEditingController. - Added the Signals integration:
useSignalanduseComputedown and observe the upstream object they create,useSignalValueobserves a borrowed source,useSignalEffectowns a reactive effect and its cleanup, andSignalValueBuilderrebuilds only its own subtree.useComputedanduseSignalEffectrun the latest callback on the next reactive evaluation;keysrecreate the slot and are not a list of tracked signals. Hook-owned signals rejectautoDispose: true, and a key change hands the retired signal to Noir'sState.deferDisposeso a child observer never reads a signal released too early. Automatic whole-build tracking is not part of this release. - Added
package:noir_signals/noir_signals.dartas the one authoring entrypoint. It also re-exports thesignals_coreprimitives an application needs to declare a model. Noir's hookEffecttypedef keeps its name; the upstream class of the same name is excluded from the re-export.