Dotted<Slice>

type
types.ts:1482

Dotted keys of a slice: top-level keys or any nested path.

A slice that **is** one value — a primitive, a Map, a Set, a Date — has no key to address, and its only subscribable path is the empty one. Saying so is what makes { reducer, property: "" } type-check where it can actually fire, instead of falling through to the untyped property: string overload and returning unknown. The conditional distributes over unions, which is why a nullable object slice gets both: Dotted<{ a: number } | null> is "" | "a". That is exactly right — such a slice really does change at its root when it becomes null, and at "a" otherwise.

Definition

type
type Dotted<Slice> = Slice extends RootValue ? "" : keyof Slice & string | Path<Slice>

Slice extends RootValue ? "" : keyof Slice & string | Path<Slice>

Type parameters

NameTypeDescription
SliceSlice state type.