Skip to main content

PatchHandler

@rotorsoft/act-root


@rotorsoft/act-root / act/src / PatchHandler

Type Alias: PatchHandler<TState, TEvents, TKey>

PatchHandler<TState, TEvents, TKey> = (event, state) => Readonly<Patch<TState>>

Defined in: libs/act/src/types/action.ts:355

Handles patching state in response to a committed event.

Type Parametersโ€‹

TStateโ€‹

TState extends Schema

State schema.

TEventsโ€‹

TEvents extends Schemas

Event schemas.

TKeyโ€‹

TKey extends keyof TEvents

Event name.

Parametersโ€‹

eventโ€‹

Committed<TEvents, TKey>

stateโ€‹

Readonly<TState>

Returnsโ€‹

Readonly<Patch<TState>>