core library
Core reactive system APIs for advanced usage.
This library exposes the low-level reactive system APIs including reactive nodes, dependency tracking, and the global reactive system. These APIs are typically used by framework implementers or for advanced reactive programming scenarios.
Classes
-
AsyncError<
T> - Represents the error state of an async operation.
-
AsyncLoading<
T> - Represents the loading state of an async operation.
-
AsyncSignalImpl<
T> -
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.
- BaseEffectNode
- Base graph node for effects and effect scopes.
-
ComputedImpl<
T> -
ComputedNode<
T> - Low-level reactive node that derives a value from dependencies.
-
ConstantImpl<
T> - Disposable
- Interface for objects that can be disposed.
- DisposableNode
- A reactive graph node that can be disposed and detached from the system.
- EffectImpl
- EffectNode
- Low-level node that runs a side-effect function when dependencies change.
- EffectScopeImpl
- EffectScopeNode
- Low-level node that owns effects created within a scope.
-
FutureSource<
T> - An async source that wraps a Future.
- JoltDebug Jolt Ecosystem
- Debug entrypoints for Jolt DevTools integration.
- JoltDebugOption
- Debug metadata for labeling and instrumenting reactive nodes.
- JoltDevTools
- VM service extension hooks used by Jolt DevTools.
- Notifiable
- A reactive value that can trigger notifications without replacing its contents.
- ReactiveFlags
- Bit flags that describe a ReactiveNode's reactive state.
- ReactiveNode
- Base node in the reactive dependency graph.
-
Readable<
T> -
A read-only container for a value of type
T. -
ReadonlyImpl<
T> -
SignalImpl<
T> -
SignalNode<
T> - Low-level reactive node that stores a mutable value.
-
StreamSource<
T> - An async source that wraps a Stream.
-
WatcherImpl<
T> -
Writable<
T> -
A read/write container for a value of type
T. -
WritableComputedImpl<
T>
Enums
- DebugNodeOperationType
- Debug lifecycle operations emitted for reactive nodes.
Mixins
- CleanableNode
- Registers disposers that run when an effect node is cleaned up or disposed.
Extensions
-
JoltComputedReadonlyExtension
on Computed<
T> - Readonly views for Computed values.
-
JoltSignalReadonlyExtension
on Signal<
T> - Readonly views for writable Signal values.
-
JoltWritableComputedReadonlyExtension
on WritableComputed<
T> - Readonly views for WritableComputed values.
Functions
-
captureReactiveNode(
Readable readable) → ReactiveNode? -
Returns the backing ReactiveNode for
readable, if one can be resolved. -
endBatch(
) → void - Ends the current batch and flushes pending effects when the outer batch ends.
-
flushEffects(
) → void - Runs every effect currently queued for notification.
-
getActiveScope(
) → EffectScopeNode? - The effect scope that currently owns newly created effects.
-
getActiveSub(
) → ReactiveNode? - The effect or computed node that is currently collecting dependencies.
-
getBatchDepth(
) → int - Returns the current nested batch depth.
-
getCycle(
) → int - Returns the current dependency-tracking generation.
-
getRunDepth(
) → int - Returns how many effects are currently executing.
-
link(
ReactiveNode dep, ReactiveNode sub, int version) → void -
Registers
depas a dependency ofsubforversion. -
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.
-
propagate(
Link theLink, bool innerWrite) → void - Propagates changes through the reactive graph.
-
purgeDeps(
ReactiveNode sub) → void - Removes all dependency links from a subscriber so future tracking starts from a clean slate.
-
setActiveScope(
[EffectScopeNode? scope]) → EffectScopeNode? - Sets the ambient scope for newly created effects.
-
setActiveSub(
[ReactiveNode? sub]) → ReactiveNode? - Sets the subscriber that should collect subsequent dependencies.
-
setEffectQueue(
int index, EffectNode? e) → void -
Stores
ein the global effect queue atindex. -
shallowPropagate(
Link theLink) → void -
Marks direct subscribers reachable from
theLinkdirty. -
startBatch(
) → void - Begins a batch so multiple writes can be coalesced before effects run.
-
trigger<
T> (T fn()) → T -
Runs
fnwhile collecting the nodes it reads, then propagates those nodes. -
unlink(
Link link, [ReactiveNode? sub]) → Link? -
Removes
linkfrom the dependency graph.
Typedefs
- ComputedEqualsFn = bool Function(dynamic value, dynamic previous)
- Compares a computed result with its previous value for equality.
- JoltDebugFn = void Function(DebugNodeOperationType type, ReactiveNode node)
- A debug callback for reactive node operations.