EffectScope class abstract

Interface for effect scopes that manage the lifecycle of effects.

EffectScope allows you to group related effects together and dispose them all at once. It's useful for component-based architectures.

Example:

EffectScope scope = EffectScope()
  ..run(() {
    final signal = Signal(0);
    Effect(() => print(signal.value));
  });
scope.dispose(); // Disposes all effects in scope
Implemented types

Constructors

EffectScope({bool? detach, JoltDebugOption? debug})
Creates a new effect scope.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
isDisposed bool
Whether this node has been disposed.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

dispose() → void
Disposes this node and cleans up resources.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onCleanUp(Disposer fn) → void
Registers a cleanup function to be called when the scope is disposed.
run<T>(T fn()) → T
Runs a function within this scope's context.
toString() String
A string representation of this object.
inherited

Operators

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