I have two reducers combined using combineReducers()
- UI Reducer has a
'isLoginOpen'
key (true/false) - When true a login modal appears. - Auth Reducer has
'isAuthenticated'
key - (true/false) Which states if the user is logged in
I also have an action creator called OpenLoginModal()
which causes the UI reducer to make 'isLoginOpen' to become true.
I only want to allow this behavior when 'isAuthenticated'
is false. I.E, I only allow to show the login modal when the user isn't logged in.
The problem is: 'isAuthenticated'
is in a different reducer, and I don't want to duplicate it to UI reducer.
How should I resolve this issue?