Fine-grained **single-path** selector for a reducer's state.
Re-renders only when the specified reducer.property (dotted path) actually changes.
For most applications, prefer using the typed version from createHooks
which infers all type parameters automatically.
**Supports**
- Exact root prop: { reducer: "todo", property: "data" }
- Exact deep path: { reducer: "todo", property: "data.123.title" }
- Wildcards (pattern): { reducer: "todo", property: "data.*" } or "data.**"
**Overloads**
- Exact path (no *): returns the precise PathValue when map is omitted
- Exact path + map: returns T from map(value)
- Glob path (with */**): requires map and returns T from map(state)
useAtomicProp<R, S, R1, P, T>(spec, map, isEqual?): T
Fine-grained **single-path** selector for a reducer's state.
Re-renders only when the specified reducer.property (dotted path) actually changes.
For most applications, prefer using the typed version from createHooks
which infers all type parameters automatically.
**Supports**
- Exact root prop: { reducer: "todo", property: "data" }
- Exact deep path: { reducer: "todo", property: "data.123.title" }
- Wildcards (pattern): { reducer: "todo", property: "data.*" } or "data.**"
**Overloads**
- Exact path (no *): returns the precise PathValue when map is omitted
- Exact path + map: returns T from map(value)
- Glob path (with */**): requires map and returns T from map(state)
useAtomicProp<R, S, R1, P, T>(spec, map, isEqual?): T
Fine-grained **single-path** selector for a reducer's state.
Re-renders only when the specified reducer.property (dotted path) actually changes.
For most applications, prefer using the typed version from createHooks
which infers all type parameters automatically.
**Supports**
- Exact root prop: { reducer: "todo", property: "data" }
- Exact deep path: { reducer: "todo", property: "data.123.title" }
- Wildcards (pattern): { reducer: "todo", property: "data.*" } or "data.**"
**Overloads**
- Exact path (no *): returns the precise PathValue when map is omitted
- Exact path + map: returns T from map(value)
- Glob path (with */**): requires map and returns T from map(state)
Type parameters
Name
Type
Description
R
extendsstring
S
extendsRecord<R, any>
R1
extendsstring
P
extendsstring
T
—
Parameters
spec — object with:
Name
Type
Description
property
P
reducer
R1
Name
Type
Description
map
(value: any) => T
Name
Type
Description
isEqual?
(a: T, b: T) => boolean
Returns
T
Example
example
const { useAtomicProp } = createHooks(AppStoreContext);function TodoTitle({ index }: { index: number }) { // Types are inferred — no explicit generics needed const title = useAtomicProp({ reducer: 'todos', property: `items.${index}.title`, }); return <span>{title}</span>;}
Fine-grained **single-path** selector for a reducer's state.
Re-renders only when the specified reducer.property (dotted path) actually changes.
For most applications, prefer using the typed version from createHooks
which infers all type parameters automatically.
**Supports**
- Exact root prop: { reducer: "todo", property: "data" }
- Exact deep path: { reducer: "todo", property: "data.123.title" }
- Wildcards (pattern): { reducer: "todo", property: "data.*" } or "data.**"
**Overloads**
- Exact path (no *): returns the precise PathValue when map is omitted
- Exact path + map: returns T from map(value)
- Glob path (with */**): requires map and returns T from map(state)
Type parameters
Name
Type
Description
R
extendsstring
S
extendsRecord<R, any>
Parameters
spec — object with:
Name
Type
Description
property
string
reducer
R
Returns
unknown
Example
example
const { useAtomicProp } = createHooks(AppStoreContext);function TodoTitle({ index }: { index: number }) { // Types are inferred — no explicit generics needed const title = useAtomicProp({ reducer: 'todos', property: `items.${index}.title`, }); return <span>{title}</span>;}
Fine-grained **single-path** selector for a reducer's state.
Re-renders only when the specified reducer.property (dotted path) actually changes.
For most applications, prefer using the typed version from createHooks
which infers all type parameters automatically.
**Supports**
- Exact root prop: { reducer: "todo", property: "data" }
- Exact deep path: { reducer: "todo", property: "data.123.title" }
- Wildcards (pattern): { reducer: "todo", property: "data.*" } or "data.**"
**Overloads**
- Exact path (no *): returns the precise PathValue when map is omitted
- Exact path + map: returns T from map(value)
- Glob path (with */**): requires map and returns T from map(state)
Type parameters
Name
Type
Description
R
extendsstring
S
extendsRecord<R, any>
T
—
Parameters
spec — object with:
Name
Type
Description
property
string
reducer
R
Name
Type
Description
map
(value: any) => T
Name
Type
Description
isEqual?
(a: T, b: T) => boolean
Returns
T
Example
example
const { useAtomicProp } = createHooks(AppStoreContext);function TodoTitle({ index }: { index: number }) { // Types are inferred — no explicit generics needed const title = useAtomicProp({ reducer: 'todos', property: `items.${index}.title`, }); return <span>{title}</span>;}