Since enable caused the policy function to be called for every action dispatched to the store, any action(s) dispatched between state.cognito.state transitions could caused duplicate calls of the policy function.
To fix this the store subscription handler checks if state.cognito.state has changed and only calls the policy function if it has.
Fix isotoma/react-cognito/issues/35
Since
enable
caused the policy function to be called for every action dispatched to the store, any action(s) dispatched betweenstate.cognito.state
transitions could caused duplicate calls of the policy function.To fix this the store subscription handler checks if
state.cognito.state
has changed and only calls the policy function if it has.