Closed jisuo closed 6 years ago
I figured it out, this works:
import { bindActionCreators } from 'redux';
...
const actions = dispatch => ({
todoActions: bindActionCreators(TodoActions, dispatch),
reminderActions: bindActionCreators(ReminderActions, dispatch),
});
this.unsubscribe = $ngRedux.connect(this.mapState, actions)(this);
...
this.todoActions.addTodo(todo);
this.reminderActions.addReminder(reminder);
So lets say I have this:
And now I also want to connect my
ReminderActions
in the same Controller.How do I do that without duplicating code like:
this.unsubscribe2 = $ngRedux.connect(this.mapStateToThis2, ReminderActions)(this);