redux-actions-lite
v0.1.1
Published
Flux Standard Action utlities simplified for Redux
Downloads
4
Readme
redux-actions-lite
redux-actions simplified
Notorious action types are overrated. There is absolutely no need for a developer to type action constants for every action - this can be done under the hood. This library offers a higher-order action creator, actionType(textDescription, ...actionCreatorArgs)
, which omits the first argument of createAction(type, payloadCreator, metaCreator)
, i.e. type
, replacing it with a much more useful description
parameter. You are welcome to see it for yourself.
Installation
npm i redux-actions-lite --save
Usage
import { actionType } from 'redux-actions-lite';
const dismissError = actionType('Dismissing alert directly or by timeout',
(action) => ({ action }), ({ meta }) => meta);
const notificationMsg = actionType('Display notification',
k => k,
() => ({ previousAction: { meta: { timestamp: new Date() - 0 } } }));