Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Immutable.js #51

Closed
adamalbrecht opened this issue Aug 12, 2015 · 7 comments
Closed

Support for Immutable.js #51

adamalbrecht opened this issue Aug 12, 2015 · 7 comments

Comments

@adamalbrecht
Copy link

Since upgrading to 1.0, support for Immutable.js has stopped working. It shows the raw immutable object rather than converting it to JS.

There is some discussion of this in #48

screen shot 2015-08-12 at 10 13 57 am

@danielkcz
Copy link
Contributor

Ah, so you were faster than me to report this. Thanks :) As @gaearon mentioned, this should be solved with duck typing, perhaps checking if there is a toJS method and invoking it before passing for any checks.

@hugooliveirad
Copy link

I hit the same problem, but I'm using mori for my data-structures. I think the DevTools component could receive converter, a function that would be applied as a map function for the whole state.

<DebugPanel top right bottom>
  <DevTools 
    store={store}
    converter={mori.toJs}
    monitor={LogMonitor} />
</DebugPanel>

@danielkcz
Copy link
Contributor

@hugobessaa I see that even mori implements iterator interface, so there is really no need for a converter. We just need someone willing to implement (see #66).

@hugooliveirad
Copy link

Oh, I see. Nice.

@weltenwort
Copy link

For everyone who's waiting for that pull request to be merged, here's a small workaround via the select property of the DevTools component:

let selectDevToolsState = (state = {}) => Immutable.fromJS(state).toJS();

<DebugPanel top right bottom key="debugPanel">
    <DevTools store={store} select={selectDevToolsState} monitor={LogMonitor} />
</DebugPanel>

It's a bit crude, but does the job for now.

@gaearon
Copy link
Contributor

gaearon commented Aug 23, 2015

Should be fixed in 1.1.0, please verify.

@weltenwort
Copy link

👍 works for me, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants