You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ ] Regression (a behavior that used to work and stopped working in a new release)
[x ] Bug report
[ ] Feature request
[ ] Documentation issue or request
What is the current behavior?
When using the StoreRouterConnectingModule with some parent/child route resolve there is an infinite Loop
Expected behavior:
No infinite Loop
Minimal reproduction of the problem with instructions:
We have a HomeComponent (loaded with a route, let's call it parent)
And a ShowInfoComponent (loaded lazy on a child route, let's call it child)
And we have domain data on the server which gets loaded async by an effect into the store.
Now i don't know if it's the best practice, but to have the domain data loaded async right at the beginning of the HomeComponent, i created a resolve on this route, to wait and load the domain data.
Now when the parent route gets activated this domain data is present.
The child route also has a resolve on it, it needs to get some Info from the domain-data.
This scenario creates an infinite loop when the StoreRouterConnectingModule is loaded, without it, everything works as espected.
I get a lot of ROUTERNAVIAGTION_CANCELLED, i don't know why, as nothing gets cancelled.
The router just waits for the domain data on the HomeComponent via the resolve, and then it waits on the child route also for the resolve to read some info out of the store (the domain data gets written into the ngrx store)
Version of affected browser(s),operating system(s), npm, node and ngrx:
I guess it has something to do, that the store gets updated (an action is dispatched) inside a route-guard / route-resolver
Update:
The problem dissappears if you remove the routerReducer from the State. so just haveing the StoreRouterConnectingModule works without the routerReducer
The text was updated successfully, but these errors were encountered:
Hi @nickwinger
I had the same requirement and I wrote an EFFECT which subscribes on ROUTENAVIGATION_UPDATE and fetches the domain data from server api and dispatches an load_success action. Reducer then updates the state with domain data. Hence by the time component loads up component get the domain data from the state via selectors.
I'm submitting a...
What is the current behavior?
When using the StoreRouterConnectingModule with some parent/child route resolve there is an infinite Loop
Expected behavior:
No infinite Loop
Minimal reproduction of the problem with instructions:
We have a HomeComponent (loaded with a route, let's call it parent)
And a ShowInfoComponent (loaded lazy on a child route, let's call it child)
And we have domain data on the server which gets loaded async by an effect into the store.
Now i don't know if it's the best practice, but to have the domain data loaded async right at the beginning of the HomeComponent, i created a resolve on this route, to wait and load the domain data.
Now when the parent route gets activated this domain data is present.
The child route also has a resolve on it, it needs to get some Info from the domain-data.
This scenario creates an infinite loop when the StoreRouterConnectingModule is loaded, without it, everything works as espected.
I get a lot of ROUTERNAVIAGTION_CANCELLED, i don't know why, as nothing gets cancelled.
The router just waits for the domain data on the HomeComponent via the resolve, and then it waits on the child route also for the resolve to read some info out of the store (the domain data gets written into the ngrx store)
Version of affected browser(s),operating system(s), npm, node and ngrx:
@angular: 4.4.4
"@ngrx/effects": "^4.0.5",
"@ngrx/router-store": "^4.0.4",
"@ngrx/store": "^4.0.3",
"rxjs": "5.4.2",
npm 5.3.0
node 8.6.0
windows 7
chrome newest
Other information:
I guess it has something to do, that the store gets updated (an action is dispatched) inside a route-guard / route-resolver
Update:
The problem dissappears if you remove the routerReducer from the State. so just haveing the StoreRouterConnectingModule works without the routerReducer
The text was updated successfully, but these errors were encountered: