AtomContext<T> class abstract

Passed to the Atom.$read method, allowing you to interact with other atoms and manage the lifecycle of your state.

Constructors

AtomContext()

Properties

hashCode int
The hash code for this object.
no setterinherited
registry AtomRegistry
Unsafely access the registry
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

call<R>(Atom<R> atom) → R
Get the value for the given atom.
get<R>(Atom<R> atom) → R
Get the value for the given atom.
mount(Atom atom) → void
Subscribe to the given atom without listening for changes.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
once<R>(Atom<R> atom) → R
Get the value for the given atom once.
onDispose(void cb()) → void
Register an cb function, that is called when the atom is invalidated or disposed.
refresh(RefreshableAtom atom) → void
Refresh the givem atom.
refreshSelf() → void
Refresh the current atom
self() → T?
Get the value of the current atom.
set<R, W>(WritableAtom<R, W> atom, W value) → void
Set the value for the given atom.
setSelf(T value) → void
Set the value for the current atom.
stream<A>(Atom<A> atom) Stream<A>
Subscribe to the given atom.
subscribe<A>(Atom<A> atom, void handler(A value), {bool fireImmediately = false}) → void
Subscribe to the given atom, automatically cancelling the subscription when this atom is disposed.
subscribeWithPrevious<A>(Atom<A> atom, void handler(A? previous, A value), {bool fireImmediately = false}) → void
Subscribe to the given atom, automatically cancelling the subscription when this atom is disposed.
toString() String
A string representation of this object.
inherited

Operators

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