SignalReaction<T> class

============================================================================ EFFECTS AND REACTIONS

Reaction - Execute side effects when signal changes.

Reactions run callbacks in response to signal changes.

Basic Usage

final count = Signal<int>(0);

final reaction = SignalReaction(
  count,
  (value) {
    print('Count changed to: $value');
  },
);

// Don't forget to dispose!
reaction.dispose();

Constructors

SignalReaction(Signal<T> signal, void callback(T value), {bool when(T oldValue, T newValue)?, bool fireImmediately = false})

Properties

callback → void Function(T value)
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
signal Signal<T>
final
when bool Function(T oldValue, T newValue)?
final

Methods

dispose() → void
Dispose the reaction.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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