import riduce from 'riduce'

riduce(initialState, riducerDict?)

Function parameters

initialState: any

The initial Tree state of the resultant reducer.

riducerDict (optional): object

TypeScript: RiducerDict (type)

Custom reducer logic: see riducerDict and customRiducer

Return value

An array with two elements:

0th element: reducer (function)

TypeScript: Reducer (type)

The reducer function (for createStore or useReducer)

1st element: actions (object)

TypeScript: ActionsProxy (type)

The actions object (for creating actions to be dispatched)