StateReducer<S>: ((state, patch) => Readonly<S>)

Type Parameters

Type declaration

    • (state, patch): Readonly<S>
    • State reducers apply partial state patches to a state, and returns the new state

      • state the original state
      • patch the patches to apply, considering rules like:
        • using undefined values to delete fields from the original state
        • recursively merging vs copying objects (like arrays)

      Parameters

      • state: Readonly<S>
      • patch: Readonly<Patch<S>> | undefined

      Returns Readonly<S>

Generated using TypeDoc