Open HoraceShmorace opened 7 years ago
I'm not sure yet why this is only happening when using applyMiddleware
, but I'm pretty sure you shouldn't store a class instance (cognito.userPool
) in state since its properties are inherently mutable by its own methods (and thus, mutations can happen outside of a reducer).
Issue
setupCognito
doesn't seem to play nicely with Redux'sapplyMiddleware
, resulting in a Redux state mutation error.Steps to reproduce:
applyMiddleware
fromredux
.createStore
, passing a call toapplyMiddleware
(which can be passed any middleware).setupCognito
.Symptom This results in the following error:
The error seems triggered by the call to
setupCognito
.