-
I want to store the MediaStream object in my redux store. As this is a class, it is clearly non-serializable. As a result, I get the following warning when I try to do this when using the default config: index.js:1 A non-serializable value was detected in action, in the path: `payload`. Value: Based on #339 and the documentation I, therefore, changed my config to the following: import { configureStore } from "@reduxjs/toolkit";
import callSlice from "./call-slice";
const store = configureStore({
reducer: callSlice.reducer,
middleware: (gDM) =>
gDM({
// Disable serializable checks for certain actions
serializableCheck: {
ignoredActions: [callSlice.actions.setLocalStream.type],
},
}),
});
export const callActions = callSlice.actions;
export default store; After reading the documentation, I think this is the cleanest way to do this without encountering unexpected time travel bugs when working with the Redux DevTools. To my knowledge, the only downside is that I can not use the Redux DevTools time travel function to investigate the ignored actions. Are there any other downsides of using the above method that I overlooked that require me to use the react context API or a custom hook better instead? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Another thing is the data, which is non-serializable, is not persistable... |
Beta Was this translation helpful? Give feedback.
Another thing is the data, which is non-serializable, is not persistable...