const makeCursor: <T>(
pair: Pair<T>,
defaults?: NonNullable<T>,
keep?: CursorMap<T>,
) => [Cursor<T>, CursorMap<T>]
Make a Cursor<T>
from a [value, updater]
pair.
CursorMap
of cached cursors. This is filled in whenever cursor.foo.…
is accessed.value
, pass the map as keep
to preserve child cursors for unchanged parts.keep
.See makeUseCursor
.
packages / state / src / cursor.ts