Open eatyourgreens opened 2 years ago
configureStore
includes middleware that warns if you pass an action payload that isn't serialisable:
https://redux-toolkit.js.org/api/serializabilityMiddleware
That's very good practice but the Resource objects returned by the API client aren't serialisable, so this will break the store wherever a resource is fetched by the API client then dispatched directly in an action, without first destructuring it to a static snapshot. The reasoning behind this is that store state cannot be mutated outside the store, but API client Resource objects are mutable objects by design eg. resource.update(changes)
.
See https://github.com/zooniverse/pandora/pull/253 for the changes to reducers and action creators that were required to get this working in the translations editor.
Replace
createStore
withconfigureStore
.See the discussion in https://github.com/reduxjs/redux/issues/4325
Nice to have, but not high priority.