rememberAtomState

fun <T> rememberAtomState(atom: Atom<T>, store: AtomStore = LocalAtomOwner.current): AtomState<T>

Remember an AtomState for the specified Atom reference key.

Return

The AtomState for the specified Atom reference key.

Parameters

T

The type of the state value.

atom

The reference key.

store

The AtomStore that manages the state using the atom reference key. By default, it resolves using LocalAtomOwner.