const refinePair: <T, K extends keyof<T>>(
pair: Pair<T>,
key: K,
defaults?: Record<K, any>,
) => Pair<T[K]>
Refine a getter/updater pair to traverse its value[key]
and produce new pair.
If defaults
are supplied, the cursor will merge them in.
When the first update is made, it will dispatch a $set operation first to permanently insert them, and allow a clean patch to be made.
packages / state / src / cursor.ts