Skip to content

feat(lib): provide store functionality (resubmitted) #187

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

Merged

Conversation

derrickpelletier
Copy link
Contributor

For #19

This started as a fork of #185.

What this does

  • adds ability to provide an existing redux store instead of always creating a new one.
  • when a store is provided, a local copy is made within ng-redux which is always updated with the full state of the primary store.
  • dispatches to the ng-redux copy are proxied back to the primary store via middleware.

Notes

Credit to @AntJanus for getting the ball rolling on this. I couldn't think of a better solution to the problem, but open to suggestions.

@AntJanus, unlike your implementation, i stuck to always returning the ng-redux store and just proxying dispatches back up instead of returning the merge of the provided store with the patched in subscribe method from the ng-redux store. If this isn't optimal, let me know.

@deini, you were mentioned in the original PR for feedback, so mentioning you here again.

@derrickpelletier derrickpelletier changed the title Feature/provide store feat(lib): provide store functionality (resubmitted) Jan 18, 2018
Copy link

@KatFishSnake KatFishSnake left a comment

Choose a reason for hiding this comment

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

Really looking forward to it

and middleware/enhancer support to provided mode
@derrickpelletier
Copy link
Contributor Author

Small update:

  1. added initial dispatch when wrapping the provided store to trigger pulling in the current state.
  2. added support to the provided-store mode for middleware and enhacers.

@AntJanus
Copy link
Collaborator

Alright! I'm gonna merge this in :) Thank you for the hard work @derrickpelletier

@AntJanus AntJanus merged commit 9f855ae into angular-redux:release/4.0.0 Jan 30, 2018
@derrickpelletier
Copy link
Contributor Author

Thanks @AntJanus!
Can we get this released under an alpha or beta version tag on npm?

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.

4 participants