ng-redux
ng-redux copied to clipboard
Pass custom combine reducers function
Hi,
This PR aims to add custom combineReducers function to the $ngReduxProvider, which is extremely helpfull if you want to use libraries such as redux-immutable for example.
import reducers from './reducers';
import myCombineReducers from 'redux-immutable';
import loggingMiddleware from './loggingMiddleware';
import ngRedux from 'ng-redux';
angular.module('app', [ngRedux])
.config(($ngReduxProvider) => {
$ngReduxProvider.combineReducersFunc(myCombineReducers);
reducer3 = functtion(state, action){}
$ngReduxProvider.createStoreWith({
reducer1: "reducer1",
reducer2: function(state, action){},
reducer3: reducer3
}, ['promiseMiddleware', loggingMiddleware]);
});
By passing $ngReduxProvider.combineReducersFunc(myCombineReducers);, ngRedux will use the new myCombineReducers function instead of the default one that comes with redux.
This PR starts from this other PR https://github.com/wbuchwalter/ng-redux/pull/76
Let me know what you think. Thanks
@hgsigner I was thinking maybe you want to rename combineReducersFunc to setCombineReducersFunc to be more explicit
@Fire-Dragon-DoL done.