Atom<T, A> constructor

Atom<T, A>({
  1. required String key,
  2. required T initialState,
  3. Storage? storage,
  4. required dynamic reducer(
    1. dynamic,
    2. dynamic
    ),
})

Implementation

Atom({required this.key, required T initialState, this.storage, required this.reducer}) {
  valueNotifier = ValueNotifier(storage != null ? storage!.get<T>(key) ?? initialState : initialState);
  atoms.add(this);
}