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
-
AsyncSignalImpl<
T> - Implementation of AsyncSignal that manages async state transitions.
-
ComputedImpl<
T> - Implementation of Computed that automatically updates when its dependencies change.
-
ComputedReactiveNode<
T> - Base reactive node for computed values.
-
CustomReactiveNode<
T> - Base class for custom reactive nodes with custom update logic.
-
DelegatedReadonlySignal<
T> - A read-only signal that shares a source with reference counting.
-
DelegatedRefCountHelper<
T> - Helper class for managing reference-counted shared resources.
-
DelegatedSignal<
T> - A writable signal that shares a source with reference counting.
- EffectBaseReactiveNode
- Shared contract for effect-like nodes that can be disposed.
- EffectImpl
- Implementation of Effect that automatically runs when its dependencies change.
- EffectReactiveNode
- Reactive node that runs a side-effect callback when triggered.
- EffectScheduler
- Interface for effects that provide custom scheduling behavior.
- EffectScopeImpl
- Implementation of EffectScope for managing the lifecycle of effects and other reactive nodes.
- EffectScopeReactiveNode
- Reactive node that groups multiple effects for scoped disposal.
-
IterableSignalImpl<
E> - Implementation of IterableSignal that computes its value from a getter function.
- JFinalizer
- A finalizer utility for managing disposers attached to Jolt objects.
- JoltDebug
- JoltStreamHelper
- Link
- Link between reactive nodes in the dependency graph.
-
ListSignalImpl<
E> - Implementation of ListSignal that automatically notifies subscribers when modified.
-
MapSignalImpl<
K, V> - Implementation of MapSignal that automatically notifies subscribers when modified.
- Notifiable
- Interface for reactive values that can be manually notified.
- ReactiveFlags
- Flags for tracking reactive node state.
- ReactiveNode
- Base class for all reactive nodes in the dependency graph.
-
Readable<
T> - Interface for readable reactive values.
-
ReadonlySignalImpl<
T> - Implementation of Signal that holds a value and notifies subscribers when it changes. Base implementation of read-only signal for storing state and tracking dependencies.
-
SetSignalImpl<
E> - Implementation of SetSignal that automatically notifies subscribers when modified.
-
SignalImpl<
T> - Implementation of Signal that holds a value and notifies subscribers when it changes.
-
SignalReactiveNode<
T> - Base reactive node for writable signals.
-
Stack<
T> - Stack data structure for managing recursive operations.
-
WatcherImpl<
T> - Implementation of Watcher that observes changes to reactive sources and executes a callback.
-
Writable<
T> - Interface for writable reactive values.
-
WritableComputedImpl<
T> - Implementation of WritableComputed that can be both read and written.
Enums
- DebugNodeOperationType
- Types of operations that can be debugged in the reactive system.
Mixins
- DisposableNodeMixin
- Mixin providing base disposal functionality for reactive nodes.
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.
-
getCustom(
ReactiveNode node) → void -
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.
-
notifyCustom<
T> (ReactiveNode node) → void - Invalidates a custom reactive node so that subscribers re-evaluate without changing the stored value.
-
notifyEffect(
ReactiveNode e) → void - Enqueues an EffectReactiveNode chain for execution.
-
notifySignal<
T> (SignalReactiveNode 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.
-
updateCustom<
T> (ReactiveNode node) → bool - Updates a custom reactive node and returns whether its 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.