Skip to main content

Reducer Abstract (core)

Functions

createReducer

Creates a reducer function from an initial state and one or more action handlers

import { createReducer } from '@hexajs-dev/core';
function createReducer<T>(initialState: T, ...handlers: OnHandler<T, any>[]): (state: T | undefined, action: HexaAction | HexaActionWithPayload<string, any>) => T