ngrx / store-devtools

Developer Tools for @ngrx/store
MIT License
326 stars 38 forks source link

How to deserialize state so we can use ImmutableJs with the chrome extension #34

Closed maxime1992 closed 7 years ago

maxime1992 commented 7 years ago

I followed the installation method with chrome app.

But I'm using immutableJs and I can't timetravel, undo/redo within the chrome app.

With Redux, this is the basic setup to have the app working with ImmutableJs. See deserializeState(state) part :

const store = createStore(rootReducer, window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__({
  deserializeState: (state) => ({
    todos: {
      ...state.todos,
      todoList: Immutable.fromJS(state.todos.todoList)
    }
  })
}));

Is it possible to use deserializeState from store-devtools ? If so, how to ? I've been looking at the doc but I couldn't find anything.

PS: This might be related to https://github.com/ngrx/store-devtools/issues/33 but I tried to give more information here.

maxime1992 commented 7 years ago

Ok weird ... The chrome app (V2.8.5) is not working with immutableJs because it doesn't have the option "serialize the state".

It's working well on firefox (V2.8.0). Notice that firefox app has the "serialize state" option !

maxime1992 commented 7 years ago

I asked why the option is available in FF and not in Chrome here.

I do not think it's related to ngrx/store-devtools so I'm closing now. Feel free to reopen/discuss if needed.

johnchristopherjones commented 7 years ago

ngrx/store-devtools appears to serialize Map objects to {}, which appears to break a lot of the state tracking/diff/replay/timetravel. Is this related?