-
Notifications
You must be signed in to change notification settings - Fork 202
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
Observable emits data only once #450
Comments
I notice that my 3 modules [app, dashboard, solution] (lazy loaded) all import I tried but failed with: export class StoreModule {
static forRoot(): ModuleWithProviders {
return {
ngModule: StoreModule,
providers: [
StoreService,
AppStore,
{
provide: NgRedux,
useExisting: AppStore,
},
],
};
}
} And by extending RootState I confirm that the state is updated but |
If you have a main module on the top of your infrastructure, maybe importing the store only there would solve your issue |
You should only register The angular.io docs mention that providers that are registered at the root AppModule level will be available application wide.
|
I actually tried not to import on lazy-loaded modules but the error is like this
The error is from dispatch: Dispatch<RootState> = (action: Action) => {
assert(
!!this._store,
'Dispatch failed: did you forget to configure your store? ' +
'https://github.com/angular-redux/@angular-redux/core/blob/master/' +
'README.md#quick-start');
if (!NgZone.isInAngularZone()) {
return this.ngZone.run(() => this._store.dispatch(action));
} else {
return this._store.dispatch(action);
}
}; In the sub-modules, the |
Do you have a github repo or a plunker to show your example? I'm involved in a couple multi module projects using the store and this is not an issue. I think it might be in your code or how your sub modules are set up. I am happy to lend a hand if you are willing and able to share a concrete example. |
@gregkopp thanks a lot. However I end up with using ngrx/store so. Maybe I can reproduce it when I have more time. |
In the component the selector is like this:
The first epic will trigger the
solutions$
to emit data, however if I click other pages and click back again the observable never emits data again. The log is like this:The
received selector
log shows the behavior.The reducer method should be alright (modified to force new object purposely):
I also tried to subscribe manually but no luck.
is it something to do with multi modules? any thoughts?
The text was updated successfully, but these errors were encountered: