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

'@ngrx/store/update-reducers' is not caught by Effects in a lazy module #1170

Closed
dmytro-gokun opened this issue Jul 4, 2018 · 3 comments
Closed

Comments

@dmytro-gokun
Copy link
Contributor

I'm trying to do some initialization after the module is loaded, but 'Actions' observable does not emit any '@ngrx/store/update-reducers'. Looks like a bug to me... If it is not then I'd like to know what is the best place to put such initialization logic in a lazy module, so its run before any other effect.

Thanks in advance.

@timdeschryver
Copy link
Member

The @ngrx/store/update-reducers is only being send to redux devtools.
There is currently an issue open, #683, to dispatch an action when the action is added.

I think the only way to handle this for now, would be to dispatch an INIT action yourself.

@dmytro-gokun
Copy link
Contributor Author

Well, in fact, it's dispatched to my reducer, so it is not only sent to devtools.
I think what happens here is that Effect's observables are subscribed to only after this event was already dispatched.

Anyways, it look like you are right and i have to dispatch something on my own.
Thanks a lot for your quick response!

@timdeschryver
Copy link
Member

Oops, you're right I was too quick to jump to conclusions.
When the module is loaded it will dispatch the update-reducers action, before the effect is loaded.

Ok if I close this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants