preset library

Classes

ComputedNode<T>
A reactive computed node that derives its value from other reactive nodes.
EffectNode<T>
A reactive effect node that runs side effects in response to changes.
EffectScopeNode
A reactive effect scope node that can participate in propagation.
LinkedEffect
A reactive node that can be linked in a queue of effects.
PresetReactiveSystem
Default implementation of the reactive system for Alien Signals.
SignalNode<T>
A reactive signal node that holds a value of type T.

Properties

activeSub ReactiveNode?
The currently active subscriber node.
getter/setter pair
batchDepth int
Current depth of nested batch operations.
getter/setter pair
checkDirty bool Function(Link link, ReactiveNode sub)
final
cycle int
Global version counter for tracking dependency updates.
getter/setter pair
final
propagate → void Function(Link link, [bool innerWrite = false])
final
queuedEffects LinkedEffect?
Head of the queue of effects waiting to be executed.
getter/setter pair
queuedEffectsTail LinkedEffect?
Tail of the effects queue for O(1) append operations.
getter/setter pair
runDepth int
Current depth of nested effect callback execution.
getter/setter pair
shallowPropagate → void Function(Link link)
final
final

Functions

disposeAllDepsInReverse(ReactiveNode sub) → void
Removes every dependency from sub, starting from the newest link.
disposeChildDepsInReverse(ReactiveNode sub) → void
Disposes child effects/scopes while leaving signal/computed deps for purge.
endBatch() → void
Ends the current batch operation.
flush() → void
Flushes all queued effects, executing them in order.
getActiveSub() ReactiveNode?
Gets the currently active subscriber node.
getBatchDepth() int
Gets the current batch depth.
purgeDeps(ReactiveNode sub) → void
Removes all stale dependencies from a subscriber node.
run(EffectNode e) → void
Executes an effect node if it needs updating.
runCleanup(EffectNode e) → void
Runs an effect cleanup outside dependency tracking.
setActiveSub([ReactiveNode? sub]) ReactiveNode?
Sets the active subscriber node and returns the previous one.
startBatch() → void
Starts a new batch operation.
stop(ReactiveNode node) → void
Stops a reactive node and removes it from the reactive system.
stopEffect(EffectNode e) → void
Stops an effect after disposing its nested effects and scopes.
stopScope(ReactiveNode node) → void
Stops a scope-like node and disposes all dependencies in reverse order.
trigger(void fn()) → void
Manually triggers reactive updates within a function.

Typedefs

EffectCallback<T> = T Function()
Callback passed to an effect.
EffectCleanup = void Function()
Cleanup function returned by an effect callback.