jolt library
Jolt is a reactive state management library for Dart and Flutter.
Start with a writable signal, derive read-only views from it, and react to visible changes with effects:
final count = Signal(0);
final doubled = Computed(() => count.value * 2);
Effect(() {
print('count=${count.value}, doubled=${doubled.value}');
});
For a guided introduction, start with the package tutorial topics. For type and member details, use the generated API reference for this library.
Classes
-
AsyncError<
T> - Represents the error state of an async operation.
-
AsyncLoading<
T> - Represents the loading state of an async operation.
-
AsyncSignal<
T> Advanced Techniques - A reactive signal that exposes the state of an asynchronous source.
-
AsyncSource<
T> - A source of AsyncState updates for AsyncSignal.
-
AsyncState<
T> - Represents the current state of an asynchronous operation.
-
AsyncSuccess<
T> - Represents the success state of an async operation with data.
-
Computed<
T> Derive State - A cached reactive value derived from other reactive state.
-
ConvertComputed<
T, U> Advanced Techniques - A writable computed value that converts through another writable source.
- Effect React To State Changes
- A reactive side effect that re-runs when its tracked dependencies change.
- EffectScope Manage Lifecycle
- A disposal boundary that groups effects, signals, and scope cleanups.
-
FutureSource<
T> - An async source that wraps a Future.
-
IterableSignal<
E> - A computed Iterable that updates when its dependencies change.
- JoltDebug Jolt Ecosystem
- Debug entrypoints for Jolt DevTools integration.
- JoltDebugOption
- Debug metadata for labeling and instrumenting reactive nodes.
-
ListSignal<
E> - A Signal that behaves like a mutable List and notifies on in-place edits.
-
MapSignal<
K, V> - A Signal that behaves like a mutable Map and notifies on in-place edits.
-
PersistSignal<
T> Advanced Techniques - A signal that persists its value to external storage.
-
Readable<
T> -
A read-only container for a value of type
T. -
Readonly<
T> Advanced Techniques - A read-only reactive view that exposes values without write APIs.
-
SetSignal<
E> - A Signal that behaves like a mutable Set and notifies on membership changes.
-
Signal<
T> Quick Start Manage State - A writable reactive value that stores owned state.
-
StreamSource<
T> - An async source that wraps a Stream.
-
Until<
T> Advanced Techniques - A cancellable future that completes when a reactive value satisfies a condition.
-
Watcher<
T> React to State Changes - Observes source values and runs a callback when their visible result changes.
-
Writable<
T> -
A read/write container for a value of type
T. -
WritableComputed<
T> - A computed value that can also write back to its source state.
Enums
- DebugNodeOperationType
- Debug lifecycle operations emitted for reactive nodes.
Mixins
-
IterableSignalMixin<
E> - Reactive Iterable iteration for types backed by a computed iterable.
-
ListSignalMixin<
E> - In-place List mutations for a Signal holding a List.
-
MapSignalMixin<
K, V> - In-place Map mutations for a Signal holding a Map.
-
SetSignalMixin<
E> - In-place Set mutations for a Signal holding a Set.
Extensions
-
JoltComputedReadonlyExtension
on Computed<
T> - Readonly views for Computed values.
-
JoltSignalReadonlyExtension
on Signal<
T> - Readonly views for writable Signal values.
-
JoltUtilsReadableExtension
on Readable<
T> - Extension methods for Readable values.
-
JoltUtilsStreamExtension
on Readable<
T> Advanced Techniques - Stream interop for Readable values.
-
JoltUtilsUntilExtension
on Readable<
T> - Extension methods for waiting on reactive values.
-
JoltUtilsWritableExtension
on Writable<
T> - Extension methods for Writable values.
Functions
-
batch<
T> (T fn()) → T Advanced Techniques -
Runs
fninside a batched notification cycle. -
onEffectCleanup(
Disposer fn, {Object? owner}) → void - Registers a cleanup function for the current effect or watcher callback.
-
onScopeDispose(
Disposer fn, {EffectScope? owner}) → void - Registers a cleanup function for the current effect scope.
-
triggerTracked<
T> (T fn()) → T -
Runs
fnin a temporary tracking context and propagates the touched values. -
untracked<
T> (T fn()) → T Advanced Techniques -
Runs
fnwithout recording reactive dependencies.
Typedefs
- JoltDebugFn = void Function(DebugNodeOperationType type, ReactiveNode node)
- A debug callback for reactive node operations.
-
SourcesFn<
T> = T Function() - Returns the source value snapshot tracked by a Watcher.
-
WatcherFn<
T> = void Function(T newValue, T? oldValue) - A change callback for Watcher.
-
WhenFn<
T> = bool Function(T newValue, T oldValue) - A predicate that decides whether a Watcher should notify.