dispatch<T, A> function

void dispatch<T, A>(
  1. A a
)

Implementation

void dispatch<T, A>(A a) {
  for (final atom in atoms) {
    final newValue = atom.reducer(atom.valueNotifier.value, a);
    atom.valueNotifier.value = newValue;
    if (atom.storage != null) {
      if (newValue == null) {
        atom.storage!.delete(atom.key);
      } else {
        atom.storage!.set(atom.key, newValue);
      }
    }
  }
}