-
Notifications
You must be signed in to change notification settings - Fork 177
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
Feature Request: use an already created store. #19
Comments
So, having looked at the source and seeing how this is actually implemented, I can see getting this to work is a little trickier than I thought. The digestMiddleware needs $rootScope. For my particular needs, I'm going to create the store in angular and pass it through ngReact into the Provider component. Edit: Yup, that works. |
Hey David, |
Why the wontfix? is it because of the injectable middleware issue? |
@wbuchwalter: what if you remove the digest middleware altogether, and do $evalAsync in the connect function? I see two benefits with this approach:
|
I would like to use this feature as well to share a store between React and Angular. No work on this happened? |
I am interested in sharing the store between Angular 1 and Angular 2 (via ng2-redux). This is actually one of the main reasons I plan on using ng(2)-redux instead of ngrx, so that it integrates better with ng1 and eases the transition for a project that is being migrated. Is there an easy/recommended way of doing this? |
Hey all, I added this to the milestones for the 4.0.0 release. In the meantime, you can easily provide an existing store via an enhancer that runs first: import myStore from '../shared/store'; // initial store setup using plain Redux
function storeProviderEnhancer() {
return () => myStore;
}
// ... in AngularJS
$ngReduxProvider.createStoreWith(state => state, [], [storeProviderEnhancer]);
// ... in Angular using angular-redux/store
this.ngRedux.provideStore(store as Store<IAppState>); |
@AntJanus using your example above seems to position the digest middleware first rather than last and this the digest loop is not updated at the correct time. Also it seems to end up causing two separate middleware chains if middleware have been configured on the original store. |
Hey all, I'm trying to wrap my head around how this could be implemented. Would love some help here. Here's currently what happens:
I looked at I'm trying to figure out how to run the I think the best way is to overwrite dispatch so that it runs on the original store and runs the I'd love any input on this. |
@AntJanus re: your concern about evaluating |
maybe I'm missing something but this is something that already works no?
|
@guillaumevincent @AntJanus can you close it up? |
@derrickpelletier ack |
I have single page application of multiple pages in AngularJs. Do we have example to achieve this? Any document link of this usage will help. |
I'm aware I'm already pretty far out on a limb here, but my project uses both react (via ngreact) and angular. We've been using redux for the react part of the application, and I'm not working to bring it to the angular portion using your module. (Great work, btw!)
We already have a redux store, and would like to just share it between the react and angular portions instead of keeping two stores in parallel by sharing the reducers. Would that be as simple as adding a .useStore() method to ngReduxProvider?
The text was updated successfully, but these errors were encountered: