gajus / redux-immutable

redux-immutable is used to create an equivalent function of Redux combineReducers that works with Immutable.js state.
Other
1.88k stars 82 forks source link

Trying to make it work with redux-auth #65

Open OriaLogic opened 7 years ago

OriaLogic commented 7 years ago

Hi,

This is not an issue but rather a question. I am trying to make redux-auth work with redux-immutable. There is an issue because redux-auth tries to access the "auth" part of the state through state.auth, which of course does not work.

I would like to define a getter allowing access to auth via state.auth every time the state changes by doing:

Object.defineProperty(
  store.getState(), 
  'auth', { 
      get: function() { return this.get('auth'); 
  } 
});

That would fix this known issue.

Could you help me with that by telling me if it is possible or not? I guess it is not a great solution but I think it would help many people.

Thanks in advance, Cheers