You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

redux-actions-generator

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redux-actions-generator

Flux Standard Action type generator for Redux.

1.0.0
latest
Source
npm
Version published
Weekly downloads
1
-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

redux-actions-generator

Flux Standard Action type generator for Redux.

NPM

Installation

The npm package provides a CommonJS build for use in Node.js, and with bundlers like Webpack and Browserify. It also includes an ES modules build that works well with Rollup and Webpack2's tree-shaking.

npm install --save redux-actions-generator

or

yarn add redux-actions-generator

Usage

createAction(prefix<string>, actions <Array<string>>)

import createActions from 'redux-actions-generator';

const actions = createActions(
    'TODO', 
    [
        'ADD_TODO',
        'TOGGLE_TODO',
        'SET_VISIBILITY_FILTER',
    ]
)

expect(actions).to.deep.equal({
    ADD_TODO: 'TODO/ADD_TODO',
    TOGGLE_TODO: 'TODO/TOGGLE_TODO',
    SET_VISIBILITY_FILTER: 'TODO/SET_VISIBILITY_FILTER',
});

Real world example

actions.js
import createActions from 'redux-actions-generator';

const actions = createActions('', [
    'ADD_TODO',
    'TOGGLE_TODO',
    'SET_VISIBILITY_FILTER',
])

export default actions;

Keywords

react

FAQs

Package last updated on 05 May 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts