-
Notifications
You must be signed in to change notification settings - Fork 32
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
Seems to break immutable.js #18
Comments
Unfortunately much of this library is dependent on the use of plain JavaScript objects, even though it really shouldn't. I'll likely have to do a few API-breaking changes so I'm going to put this off for a bit until I start working on a |
Just hit this too! Let me know if there's anything I can do to help @samiskin ! |
@hhff Unfortunately I likely won't be able to do significant work on this project for a while 😞, possibly until the very end of this year, but I'll always be open to PRs, so feel free to try implementing this on your own if its a pressing issue. I haven't used I assume a cheap solution code-wise (but perhaps costly performance-wise) would be tailoring it specifically for |
@hhff @nickyhajal Any of you managed to get this working with Immutable? Any tips? I have started to modify the codebase to see whether I'll manage. I'll keep you updated! We have a big project and need to move over to Immutable. |
@arieldf it's not possible I believe (without hacky rehydration stuff), as this project uses IPC to keep everything in sync. IPC can't transmit non-primitives. |
@hhff thanks for your quick response. Are there any alternatives that you are aware of? |
The project I was using this on is currently on my back burner but here's how I got around it (not using redux-electron-store). In the rendered window:
In the electron main.js
This is obviously pretty basic but it worked for my needs. Hope it helps! |
Thanks for the response @nickyhajal - valuable input |
heck ya! that would work! |
Might be able to get it to work within this project using https://github.com/intelie/immutable-js-diff and https://github.com/intelie/immutable-js-patch The core of this project is just that when an action happens, diff the state, send the diffs to the other processes, then apply the diff from the other processes. Theres just a couple more optimization parts (the "filter" stuff) to not send updates to a window unless the window actually cares about that update. |
@samiskin thanks a lot for the suggestion. I'll revert when I manage to solve this |
@samiskin This could be a viable solution, but I did not successfully manage yet. When will the latest release be available on NPM? I would like to work with the latest code base. Thanks again |
@samiskin Ref. the above question, there is a second alternative which is to have the root state split between an immutable state-tree and a plain JS state-tree, where everything that should be in sync with main and renderer using this lib goes into the plain JS state. What would be the best practice to accomplish this with electron-redux-store? Basically I would like a different state/reducers in main and renderer, but with a plain JS state property in common that is equal. |
@arieldf It might be able to work if you just set the I'll try to publish to NPM sometime today |
Thanks for the input @samiskin! UPDATE: using a different reducer and initial state in the main solved it ///// Doing as you proposed with the filter I get the following errors: adding the excludeUnfilteredState = true I get: |
@arieldf I published master under the |
Was this issue ever resolved? I'm encountering the same same issue when using |
Nope never ended up being able to work on it. I haven't really used Immutable.js at all so I'm not too familiar on the best ways to handle it 😞 . |
Hi there,
I'm using Immutable.JS in my state and it seems that if I have electronEnhancer() in the renderer, I get the data fine as a basic object but it breaks Immutable's functions.
For example,
getState().auth.toJS()
works without the electronEnhancer but with it I gettoJS is not a function
.The text was updated successfully, but these errors were encountered: