UseAtomicProps<R extends string, S extends Record<R, any>>

type
react/src/hooks/createHooks.ts:103

Call signature for the typed useAtomicProps hook returned by createHooks. Subscribes to multiple dotted paths across one or more reducers and recomputes a derived value when any of them change.

Definition

type
type UseAtomicProps<R extends string, S extends Record<R, any>> = (specs: { property: WithGlob<Dotted<S[R1]>> | readonly WithGlob<Dotted<S[R1]>>[]; reducer: R1 }[], selector: (state: DeepReadonly<S>) => T, isEqual?: (a: T, b: T) => boolean) => T

(specs: { property: WithGlob<Dotted<S[R1]>> | readonly WithGlob<Dotted<S[R1]>>[]; reducer: R1 }[], selector: (state: DeepReadonly<S>) => T, isEqual?: (a: T, b: T) => boolean) => T

Type parameters

NameTypeDescription
Rextends stringReducer name union.
Sextends Record<R, any>State record keyed by R.