atom<Value> function

ReadOnlyAtom<Value> atom<Value>(
  1. AtomReader<Value> create
)

Create a read only atom that can interact with other atom's to create derived state.

final count = stateAtom(0);
final countTimesTwo = atom((get) => get(count) * 2);

Implementation

ReadOnlyAtom<Value> atom<Value>(AtomReader<Value> create) =>
    ReadOnlyAtom(create);