redux-proptypes-pack
Use React.PropTypes
in your redux apps.
npm install redux-proptypes-pack
Usage
// reducers.js;; const PropTypes = React;const pack = ; const initialState = items: title: '' content: '' ; const validator = PropTypesshape items: PropTypes; { // ...} todoList validator;
Disable validating in your production environment.
// reducers.js; const disabled = processenvNODE_ENV === 'production'; const pack = ;
Then the pack
function will simplely pass your reducers to Redux.
API Reference
packCreator(disabled)
Arguments
disabled
(Boolean): The returned pack
function won't validate when the disabled
is truthy.
Returns
pack
(Function)
pack(reducer, validator)
Arguments
reducer
(Function): A redux reducer.
validator
(Function): A validtor form React.PropTypes
.
Run tests
npm test
License
MIT