# redux-bind-action-groups

> bind redux action creators function to group

Latest version **2.1.0** (published 2016-05-17) · ISC license · 0 weekly downloads

## Install

```sh
npm install redux-bind-action-groups
pnpm add redux-bind-action-groups
yarn add redux-bind-action-groups
bun add redux-bind-action-groups
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2016-05-17 |
| First published | 2016-05-13 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Eyas |
| Maintainers | eyasliu |
| Keywords | redux, bind, action, group |

## Links

- npm: https://www.npmjs.com/package/redux-bind-action-groups
- Repository: https://github.com/eyasliu/redux-bind-action-groups
- Homepage: https://github.com/eyasliu/redux-bind-action-groups#readme
- Issues: https://github.com/eyasliu/redux-bind-action-groups/issues
- npm.io page: https://npm.io/package/redux-bind-action-groups

## Dependencies (1)

- [redux](https://npm.io/package/redux.md) ^3.5.2

## Recent versions

- 2.1.0 (latest) — 2016-05-17
- 2.0.0 — 2016-05-14
- 1.0.2 — 2016-05-14
- 1.0.1 — 2016-05-13
- 1.0.0 — 2016-05-13

## README

bind redux action to group, avoid action generate function name conflict, and compatibility [redux `bindActionCreators`](https://github.com/reactjs/redux/blob/master/src/bindActionCreators.js)


[![Build Status](https://travis-ci.org/eyasliu/redux-bind-action-groups.svg?branch=master)](https://travis-ci.org/eyasliu/redux-bind-action-groups)


# install 

```shell
npm i -S redux-bind-action-groups
```

# example

my two action creator files

```js
// post.js
export function getList(){
    return {
        type: 'POST_GETLIST'
    }
}


// photo.js
export function getList(){
    return {
        type: 'PHOTO_GETLIST'
    }
}
```

bind action creator with redux bindActionCreators

```js
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

```js
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()
```

---
_Source: https://npm.io/package/redux-bind-action-groups · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
