redux-simple-action-helpers

1.0.1 • Public • Published

npm version Build Status Coverage Status Inline docs Hit Count Build Dependencies Dev Dependencies

NPM

contributions welcome

Installation

install

$ npm i redux-simple-action-helpers 
$ yarn add redux-simple-action-helpers

Motivation

action creators usually follow the same rules. Get input, create flux standard action based on input

Example

action creator

import { createActionCreator } from 'redux-simple-action-helpers';

export const toggleRowItem = createActionCreator('TOGGLE_ROW_ITEM', (row, idx) => { payload : { row, idx} });

which is equal to

export const toggleRowItem = createActionCreator('TOGGLE_ROW_ITEM', ['row', 'idx']);

or

export const toggleRowItem = createActionCreator('TOGGLE_ROW_ITEM', ({row, idx}) => { payload : { row, idx} });

which is equal to

export const toggleRowItem = createActionCreator('TOGGLE_ROW_ITEM');

API

createActionCreator(type, fn);

fn = (...args) => { payload, error, meta };

or

fn = Array

License

MIT

Package Sidebar

Install

npm i redux-simple-action-helpers

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

6.51 kB

Total Files

9

Last publish

Collaborators

  • kamikazept