AtomRegistry class
Responsible for mapping atom's to their state.
Each atom corresponds to a Node
, which contains the current state for that
atom.
Constructors
-
AtomRegistry({List<
AtomInitialValue> initialValues = const [], Scheduler? scheduler})
Properties
Methods
-
get<
A> (Atom< A> atom) → A - Retrieve the state for the given Atom, creating or rebuilding it when required.
-
mount(
Atom atom) → void Function() -
Listen to an
atom
, but don't register a handler function. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
refresh(
RefreshableAtom atom) → void -
Manually recalculate an
atom
's value. -
set<
R, W> (WritableAtomBase< R, W> atom, W value) → void - Set the state of a WritableAtom.
-
stream<
A> (Atom< A> atom) → Stream<A> -
Listen to an
atom
as a Stream. -
subscribe<
A> (Atom atom, void handler(A value), {bool fireImmediately = false}) → void Function() - Listen to changes of an atom's state.
-
subscribeWithPrevious<
A> (Atom< A> atom, void handler(A? previous, A value), {bool fireImmediately = false}) → void Function() - Listen to changes of an atom's state, and retrieve the latest value.
-
toString(
) → String -
A string representation of this object.
inherited
-
use<
A> (Atom atom, FutureOr< A> fn()) → Future<A> -
Listen to an
atom
, run the givenfn
(which can return a Future), then remove the listener once thefn
is complete.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited