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

Immutable js root state #42

Merged
merged 2 commits into from
Oct 7, 2017
Merged

Conversation

fabriziomoscon
Copy link

Addresses issue #37

This patch allows to use redux-offline with a root immutable state.
These are non breaking changes on top of v2.1.0

  • added config offlineStateLens: with state getter and setter and splitter for offline state vs rest
  • added config persistAutoRehydrate: to inject another autoHydration (eg: redux-persist-immutable)
  • used offlineStateLens in the middleware and the enhancer
  • added the new flow types for the config
  • fixed config.persist flow type
  • updated the README.md

An auxiliary npm module providing immutable default configs has been published at: https://www.npmjs.com/package/redux-offline-immutable-config

This code has been written together with @Ashmalech

@wacii
Copy link
Collaborator

wacii commented Oct 5, 2017

Thanks for the PR!

Made a couple small changes to the README. Also we changed how the store enhancer is applied, so I reverted that.

@wacii wacii changed the base branch from master to develop October 5, 2017 03:54
@wacii wacii changed the base branch from develop to master October 5, 2017 03:54
@wacii
Copy link
Collaborator

wacii commented Oct 5, 2017

This needs to be merged into develop. I'll look into resolving the conflicts later this week, unless you want to rebase it again.

@fabriziomoscon
Copy link
Author

I can try rebasing, I will let you know if I get stuck

…ods (eg: redux-persist-immutable)

- add config offlineStateLens: with state getter and setter and splitter for offline state vs rest
- add config persistAutoRehydrate: to make it possible to inject another autoHydration (eg: redux-persist-immutable)
- use offlineStateLens in the middleware and the enhancer
- add the new flowtypes for the config
- update the README.md
@fabriziomoscon fabriziomoscon changed the base branch from master to develop October 5, 2017 09:51
src/index.js Outdated
config.persist && config.rehydrate
? compose(offlineMiddleware, autoRehydrate())
: offlineMiddleware;
config.persist && config.rehydrate && config.persistAutoRehydrate
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wacii Please check that I kept the correct code for this block during the rebase

@fabriziomoscon
Copy link
Author

@wacii I have rebased on top of develop and run yarn run prettier. I had one comment for a single change, but the rest was merged automatically by git.
Let me know if you need anything else.

@wacii
Copy link
Collaborator

wacii commented Oct 7, 2017

Nifty. I addressed your comment. Everything looks good.

Thanks again.

@wacii wacii merged commit 2145c3a into sorodrigo:develop Oct 7, 2017
@wacii wacii mentioned this pull request Oct 7, 2017
@wacii wacii mentioned this pull request Oct 17, 2017
@fabriziomoscon fabriziomoscon deleted the immutable-js-root-state branch February 5, 2018 11:04
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.

2 participants