redux-actions-namespace
v1.0.1
Published
Syntax sugar for using namespaces with redux-actions.
Downloads
5
Maintainers
Readme
redux-actions-namespace
Syntax sugar for using namespaces with redux-actions.
Usage
import { createNamespace } from 'redux-actions-namespace';
const { createAction, createActions } = createNamespace('UI/DROPDOWN/');
const toggle = createActions('TOGGLE');
const { show, hide } = createActions('SHOW', 'HIDE');
The code above is equivalent for this:
import { createAction, createActions } from 'redux-actions';
const NS = 'UI/DROPDOWN/';
const toggle = createActions(`${NS}TOGGLE`);
const { show, hide } = createActions(`${NS}SHOW`, `${NS}HIDE`);
License
MIT.