angular-redux / ng-redux

Angular bindings for Redux
MIT License
1.16k stars 177 forks source link

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

Closed derrickpelletier closed 6 years ago

derrickpelletier commented 6 years ago

For #19

This started as a fork of #185.

What this does

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 commented 6 years ago

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 commented 6 years ago

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

derrickpelletier commented 6 years ago

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