Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass custom combine reducers function #77

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

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