StoreDecoration<R extends string, S extends Record<R, any>, EM extends EventMapBase>
interfaceThe registration surface whose return types carry the widening.
call() are untouched; the only
runtime effect is the registration itself.
Note there is no explicit type parameter for the added event map anywhere. It is inferred
from a single value position, so the partial-inference problem never arises and no call
site needs a type argument or a cast.Type parameters
| Name | Type | Description |
|---|---|---|
R | extends string | |
S | extends Record<R, any> | |
EM | extends EventMapBase |
Methods
registerSlice
Mounts a slice and hands back both the widened store and a disposer.
The disposer is **library-private**: after it runs, the widened type still promises a
slice that is gone. Application code should take StoreDecoration.withSlice
instead, which returns no disposer at all.
withEffect
Registers an effect and returns the store widened by whatever event map it declares.
withMiddleware
Registers middleware and returns the store widened by whatever event map it declares.
Only the **spec form** can widen: MiddlewareFunction's event parameter is
EventUnion<EM>, a mapped type TypeScript cannot infer EM back out of. A bare function
therefore contributes {}.
withSlice
Mounts a slice and returns the widened store, for chaining.