redux-create-reducer
This code packaged as a node module
Usage:
;; const initialState = ; const todos =
Typescript typings
This library also provides powerful typescript typings when using Action classes:
; ; // If you wanted to exclude some actions you can use the `Exclude` type.;
Removing 'Reset Action': (state, action) => ({ value: 0 }),
in the reducer causes the error: Property '"Reset Action"' is missing in type ...
. Similarly, adding 'Nonexisting Action': (state, action) => ({ value: 0 }),
causes the type error: Object literal may only specify known properties, and ''Nonexisting Action'' does not exist in type 'Handlers<State, Actions>'.ts(2345)