Atom constructor
Atom({
- String? name,
- dynamic onObserved()?,
- dynamic onUnobserved()?,
- ReactiveContext? context,
Creates a simple Atom for tracking its usage in a reactive context. This is useful when you don't need the value but instead a way of knowing when it becomes active and inactive in a reaction.
Use the onObserved
and onUnobserved
handlers to know when the atom is active and inactive
respectively. Use a debug name
to identify easily.
Implementation
factory Atom(
{String? name,
Function()? onObserved,
Function()? onUnobserved,
ReactiveContext? context}) =>
Atom._(context ?? mainContext,
name: name, onObserved: onObserved, onUnobserved: onUnobserved);