Retax-Utils
This is a set of utils for all retax modules. It also includes 2 helpers for creating redux actions creators and reducers.
Getting started
npm install --save retax-utils
Creating a reducer
This helper creates a redux reducers. It relies on the fact that an action object must have a type
property.
; const initialState = value: 0; const reducer = ; ; /*{ value: 0}*/
Creating an actions creator
; const actionsCreator = ; ; /*{ type: 'INC'}*/ ; /*{ type: 'INC', payload: 5}*/
You could also provide a payloadCreator
and a metaCreator
(similar to redux-actions).
; const actionsCreator = ; ; /*{ type: 'INC'}*/ ; /*{ type: 'INC', payload: 10, meta: 15}*/
FAQ
I don't understand how this library is built
Check builder and builder-ts-library
Typescript support
This project is shipped with typescript typings. If you are using typescript@^1.6, you don't have to do anything, it will detect the definition types automatically.
License
MIT License (MIT)