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

Add support for immutable root reducer #159

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gobadiah
Copy link
Contributor

I know this has already been discussed at least here #80 and #81 .

I took a different approach from #81 to keep the core of the library agnostic regarding how the state is managed.

I did something very simple, this idea when having a root reducer immutable would be to import actions from redux-json-api/immutable instead of redux-json-api.

If you would be okay to integrate this, I could add documentation and some tests, I think it's important to let the developers use whatever root reducer they want.

@egeriis
Copy link
Collaborator

egeriis commented Apr 3, 2018

I like this! I'm curious how you're maintaining the state of the resources though?

@gobadiah
Copy link
Contributor Author

gobadiah commented Apr 3, 2018

thanks for the feedback @egeriis !

What do you mean by maintaining the state of the resources ? This change is very minor, all the state management is handled by the library just the same as it does now.

The important thing for this PR is that the only part which is aware of the root reducer is the actions, where we use store.getState() and access the redux-json-api state with getState().api or const { api } = getState().

Am I missing something else ?

@egeriis
Copy link
Collaborator

egeriis commented Apr 13, 2018

@gobadiah I was assuming that the entire state was Immutable.js, but the api scope is just plain JSON?

@gobadiah
Copy link
Contributor Author

gobadiah commented Apr 13, 2018 via email

@egeriis
Copy link
Collaborator

egeriis commented Apr 13, 2018

Yeah, that's what I've been envisioning. Do you mind adding the docs and tests you mention? At very least documentation note about this.

@gobadiah
Copy link
Contributor Author

gobadiah commented Apr 13, 2018 via email

@egeriis egeriis changed the base branch from 2.0 to master June 12, 2018 09:49
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

Successfully merging this pull request may close these issues.

None yet

2 participants