Skip to content

Conversation

@hgsigner
Copy link
Contributor

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 #76

Let me know what you think.
Thanks

@Fire-Dragon-DoL
Copy link

@hgsigner I was thinking maybe you want to rename combineReducersFunc to setCombineReducersFunc to be more explicit

@hgsigner
Copy link
Contributor Author

@Fire-Dragon-DoL done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants