Skip to content
This repository has been archived by the owner on Mar 9, 2021. It is now read-only.

Plans for globalizing actions via bindActionCreators? #86

Closed
tmaly1980 opened this issue Jun 17, 2017 · 1 comment
Closed

Plans for globalizing actions via bindActionCreators? #86

tmaly1980 opened this issue Jun 17, 2017 · 1 comment

Comments

@tmaly1980
Copy link

tmaly1980 commented Jun 17, 2017

I've seen the redux pattern in other projects where mapDispatchToProps is bound to all action creators through bindActionCreators... That way, it's one less thing to define in each container. For example, we'd add to a container:

import { bindActionCreators } from 'redux';
import { ActionCreators } from '../Redux';

const mapDispatchToProps = (dispatch) => {
    return bindActionCreators(ActionCreators,dispatch);
}

And Redux/index.js would also have (as an example):

import ProductActions from './ProductRedux'
import BusinessActions from './BusinessRedux'

export const ActionCreators = Object.assign({}, // This needs to be defined
  ProductActions,
  BusinessActions
)

Each reducer already exports Creators extracted from createActions(), so it seems logical to take that one step further.

@jamonholmgren
Copy link
Member

This is a cool idea but we don't plan to add this feature to Andross now that we are working primarily on Bowser. Thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants