Effect class abstract interface

A reactive effect that runs side effects in response to signal changes.

Effects automatically track their dependencies and re-run when any dependency changes. They are useful for performing side effects like DOM updates, logging, or API calls.

Use the call method to stop the effect and clean up its subscriptions.

Example:

final count = signal(0);
final dispose = effect(() {
  print('Count is: ${count()}');
});
// Later, stop the effect:
dispose();

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

call() → void
Stops this effect and removes it from the reactive system.
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