just_signals 1.0.2
just_signals: ^1.0.2 copied to clipboard
A high-performance signal-driven state management library for Flutter. Features reactive primitives, zero-GC memory pooling, surgical widget updates, and async signal support.
1.0.2 - 2026-04-19 #
Changed #
- Moved the memory management layer out of
just_signalsinto the dedicatedjust_memorypackage. ObjectPool,RoundRobinPool,MemoryArena,TypedBuffer, andPoolManagernow live injust_memoryfor clearer package boundaries and reuse across the Just ecosystem.
1.0.1 - 2026-03-07 #
Fixed the git repository URL in pubspec.yaml to point to the correct GitHub repository for just_signals.
1.0.0 - 2026-03-07 #
Initial stable release of just_signals — a high-performance, signal-driven
state management package built for Flutter and just_game_engine.
Core Signals (lib/src/core/) #
Signal<T>— mutable reactive primitive; notifies listeners only when the value actually changes. Supportsupdate(),forceNotify(), anddebugLabelfor DevTools visibility.Computed<T>— lazily evaluated derived value that automatically tracks its own dependencies and caches the result until invalidated. Detects and throws on circular dependencies.Effect— side-effect callback that auto-tracks signal access, re-runs on dependency changes, and supports optional cleanup functions. Can be paused, resumed, and manually triggered.batch()/SignalBatch.run()— defers all listener notifications until the batch completes, collapsing multiple signal writes into a single rebuild pass.transaction()— likebatch()but rolls back all signal values to their pre-transaction state if an exception is thrown.Selector<T, R>— derives a sub-value from a signal; only notifies when the selected portion changes. Extension.select()and.selectMany()available on allSignal<T>instances.combine2()/combine3()/combine4()— combines multiple signals into a singleComputed<R>value.SignalScope— lifecycle container that automatically disposes all registeredEffectinstances when the scope is disposed.
Flutter Widgets (lib/src/widgets/) #
SignalBuilder<T>— rebuilds only when a singleSignal<T>orComputed<T>changes. Accepts an optional staticchildto avoid rebuilding unchanged sub-trees.SignalConsumer— rebuilds when any signal in a provided list changes. Ideal for widgets that depend on 2–5 related signals.SignalSelector<T, R>— subscribes to a derived slice of a signal; granular rebuilds without a fullComputeddeclaration.SignalScopeWidget—InheritedWidgetwrapper that exposes aSignalScopeto the subtree, enabling automatic effect disposal tied to the widget lifecycle.SignalListenableBuilder— bridge for anyValueListenable<T>source, enablingSignalto integrate with existing Flutter APIs.
Async Support (lib/src/async/) #
AsyncSignal<T>— wraps an async operation and exposesidle,loading,data,error, andrefreshingstates as a singleSignal<AsyncSnapshot<T>>. Supports cancellation and refresh.StreamSignal<T>— wraps aStream<T>with proper lifecycle management; auto-subscribes and disposes with the signal.FutureSignal<T>— wraps aFuture<T>as a one-shot async signal, exposing the same loading/error/data pattern.
Memory Layer — Zero-GC (lib/src/memory/) #
ObjectPool<T>— pre-allocates a pool of objects and recycles them viaacquire()/release(), eliminating GC pressure in hot game-loop paths. SupportsinitialSize,maxSize, per-acquire and per-release callbacks,prewarm(),shrink(), andreleaseAll().RoundRobinPool<T>— fixed-size rotating pool;next()always returns the oldest object in the rotation, ideal for audio players and particle slots.MemoryArena— pre-allocated typedFloat32Listarena for entity position, velocity, and scale data. In-placeapplyVelocity()operation with no heap allocation per tick.TypedBuffer<T>— growable typed buffer with amortised resizing, optimised for particle and vertex data accumulation.PoolManager— centralised registry for multiple namedObjectPoolinstances;register<T>(),acquire<T>(), andrelease<T>()by key.