PresetReactiveSystem class

The default reactive graph, scheduler, and cleanup implementation.

Dispatches updates to SignalNode and ComputedNode, queues effects in notify, and releases unused dependencies in unwatched. The preset helpers share this system and the active subscriber and batch state.

Use the node types to customize value accessors while retaining the public surface API's effect lifecycle.

extension type Signal<T>._(SignalNode<T> _node) {
  factory Signal(T initialValue) => Signal._(
    SignalNode(
      flags: .mutable,
      currentValue: initialValue,
      pendingValue: initialValue,
    ),
  );

  T get value => _node.get();

  set value(T newValue) => _node.set(newValue);
}

extension type Computed<T>._(ComputedNode<T> _node) {
  factory Computed(T Function() getter) =>
      Computed._(ComputedNode(getter: (_) => getter(), flags: .none));

  T get value => _node.get();
}
Inheritance

Constructors

PresetReactiveSystem()
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

checkDirty(Link link, ReactiveNode sub) → bool
Checks if a node is dirty by examining its dependencies.
inherited
Validates that a link belongs to a node's dependency list.
inherited
Creates or updates a dependency link between two nodes.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notify(ReactiveNode effect) → void
Queues an effect for execution.
override
propagate(Link link, [bool innerWrite = false]) → void
Propagates changes recursively through the dependency graph.
inherited
shallowPropagate(Link link) → void
Propagates changes to immediate subscribers only.
inherited
toString() → String
A string representation of this object.
inherited
Removes a dependency link from the graph.
inherited
unwatched(ReactiveNode node) → void
Called when a node no longer has any subscribers.
override
update(ReactiveNode node) → bool
Updates a reactive node's value.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited