core library
Re-exports the core Jolt reactive system for Flutter integration.
This file provides access to the fundamental Jolt reactive primitives including effects, batching, and the reactive system core. These are the building blocks that power the Flutter-specific widgets and signals.
Classes
-
ComputedReactiveNode<
T> - Base reactive node for computed values.
- EffectBaseReactiveNode
- Shared contract for effect-like nodes that can be disposed.
- EffectReactiveNode
- Reactive node that runs a side-effect callback when triggered.
- EffectScopeReactiveNode
- Reactive node that groups multiple effects for scoped disposal.
- JFinalizer
- A finalizer utility for managing disposers attached to Jolt objects.
- JoltDebug
- Link
- Link between reactive nodes in the dependency graph.
- ReactiveFlags
- Flags for tracking reactive node state.
- ReactiveNode
- Base class for all reactive nodes in the dependency graph.
-
Readonly<
T> - Interface for readonly reactive values.
-
SignalReactiveNode<
T> - Base reactive node for writable signals.
-
Stack<
T> - Stack data structure for managing recursive operations.
-
Writable<
T> - Interface for writable reactive values.
Enums
- DebugNodeOperationType
- Types of operations that can be debugged in the reactive system.
Properties
- activeScope ↔ EffectScopeReactiveNode?
-
Effect scope that is currently being configured.
getter/setter pair
- activeSub ↔ ReactiveNode?
-
Effect or computed that is currently collecting dependencies.
getter/setter pair
- batchDepth ↔ int
-
Current nesting depth of
`startBatch`/`endBatch`calls.getter/setter pair - cycle ↔ int
-
Monotonically increasing counter used to stamp dependency links during
recomputation cycles.
getter/setter pair
- notifyIndex ↔ int
-
Index of the next effect to flush from queued.
getter/setter pair
-
queued
→ List<
EffectReactiveNode?> -
Ring buffer that stores pending EffectReactiveNode instances.
final
- queuedLength ↔ int
-
Number of scheduled effects stored inside queued.
getter/setter pair
Functions
-
checkDirty(
Link theLink, ReactiveNode sub) → bool - Checks if a node is dirty and needs updating.
-
defaultRunEffect(
EffectReactiveNode e, void fn()) → void - Executes an EffectReactiveNode when it is dirty or pending.
-
disposeNode(
ReactiveNode e) → void - Disposes any reactive node and detaches all dependencies/subscribers.
-
endBatch(
) → void - Ends the current batch and flushes pending effects when depth reaches zero.
-
flushEffects(
) → void - Flushes all queued effects and executes them.
-
getActiveScope(
) → EffectScopeReactiveNode? - Returns the EffectScopeReactiveNode that is currently open.
-
getActiveSub(
) → ReactiveNode? - Returns the effect or computed currently being tracked.
-
getBatchDepth(
) → int - Returns the current batch depth, where zero means no batching.
-
getComputed<
T> (ComputedReactiveNode< T> computed) → T - Returns the current value of a computed node, recomputing it when dirty and linking it to the active subscriber.
-
getSignal<
T> (SignalReactiveNode< T> signal) → T - Returns the current cached value of a signal and links it to the active subscriber.
-
isValidLink(
Link checkLink, ReactiveNode sub) → bool - Checks if a link is still valid for a subscriber.
-
link(
ReactiveNode dep, ReactiveNode sub, int version) → void - Abstract reactive system for managing dependency tracking.
-
notifyComputed<
T> (ComputedReactiveNode< T> computed) → void - Invalidates a computed node and notifies its subscribers without assigning a new value.
-
notifyEffect(
ReactiveNode e) → void - Enqueues an EffectReactiveNode chain for execution.
-
notifySignal<
T> (SignalReactiveNode< T> signal) → void - Invalidates a signal so that subscribers re-evaluate without changing the stored value.
-
propagate(
Link theLink) → 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(
[EffectScopeReactiveNode? scope]) → EffectScopeReactiveNode? - Sets the ambient EffectScopeReactiveNode and returns the previous scope.
-
setActiveSub(
[ReactiveNode? sub]) → ReactiveNode? - Sets the currently active effect or computed and returns the previous one.
-
setSignal<
T> (SignalReactiveNode< T> signal, T newValue) → T - Assigns a new pending value to a signal and schedules subscribers.
-
shallowPropagate(
Link theLink) → void - Shallow propagates changes without deep recursion.
-
startBatch(
) → void - Begins a batch so multiple writes can be coalesced before effects run.
-
trigger<
T> (T fn()) → T -
Executes
fninside a temporary subscriber and propagates any triggered signals once the callback finishes. -
unlink(
Link link, [ReactiveNode? sub]) → Link? - Unlinks a dependency from a subscriber.
-
unwatched(
ReactiveNode node) → void - Cleans up dependency links when a node no longer has subscribers.
-
updateComputed<
T> (ComputedReactiveNode< T> computed) → bool - Recomputes a ComputedReactiveNode and reports whether the pending value changed.
-
updateNode(
ReactiveNode node) → bool - Updates either a ComputedReactiveNode or SignalReactiveNode and returns whether its cached value changed.
-
updateSignal<
T> (SignalReactiveNode< T> signal) → bool - Updates a SignalReactiveNode's cached value from its pending value.
Typedefs
- JoltDebugFn = void Function(DebugNodeOperationType type, ReactiveNode node)
- Function type for debugging reactive system operations.