Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

redux-bind-action-groups

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redux-bind-action-groups

bind redux action creators function to group

  • 2.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
37
decreased by-2.63%
Maintainers
1
Weekly downloads
 
Created
Source

bind redux action to group, avoid action generate function name conflict, and compatibility redux bindActionCreators

Build Status

install

npm i -S redux-bind-action-groups

example

my two action creator files

// post.js
export function getList(){
    return {
        type: 'POST_GETLIST'
    }
}


// photo.js
export function getList(){
    return {
        type: 'PHOTO_GETLIST'
    }
}

bind action creator with redux bindActionCreators

import * as postActions from './post';
import * as photoActions from './photo';
import {bindActionCreators} from 'redux';

function mapDispatchToProps(dispatch){
    return bindActionCreators({
        ...postActions,
        ...photoActions
    }, dispatch)
}

// in React Component
this.props.getList();  // which getList will exec in post and photo

useage

import bindActionGroups from 'redux-bind-action-groups';

function mapDispatchToProps(dispatch){
    return bindActionGroups({
        post: postActions,
        photo: photoActions,
        foo: () => ({type: 'DO_SOMETHING'})
    }, dispatch)
}

// in React Component, work fine
this.props.post.getList();
this.props.photo.getList();
this.props.foo()

Keywords

FAQs

Package last updated on 17 May 2016

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc