redux-actions-namespace

1.0.1 • Public • Published

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.

Install

npm i redux-actions-namespace

DownloadsWeekly Downloads

33

Version

1.0.1

License

MIT

Last publish

Collaborators

  • fiberthrone