redux-actions-namespace

Syntax sugar for using namespaces with redux-actions.


Keywords
redux, actions, redux-actions, namespace
License
MIT
Install
npm install redux-actions-namespace@1.0.1

Documentation

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.