Search code examples
reactjsreduxredux-sagaredux-toolkit

Is there a way to store the media stream object in redux? using redux thunk or anything?


I'm working on a react project and we have a video media streams and I want to store the stream objects in my redux store but as far as I know storing non-serializable objects is not a good practice for redux, but I found some answers on google saying that redux saga should be used but no one says how? I tried redux saga but I still get the non-serializable object error.


Solution

  • No, that kind of data should simply not be put into Redux. You can hold it in a global variable, just outside of React or Redux, but it should not be put into the store.