Platform: Example app doesn't use a Router as a single point of truth

Created on 11 Sep 2017  路  4Comments  路  Source: ngrx/platform

Please change the example.

Example App wontfix

Most helpful comment

ok, so in this example you use router in the container component. Now, this container component only purpose is to make router a single point of truth. I think the whole idea of making a component as a link between app and router is not right. I like the nrwl approach better - it's just an effect and there you just dispatch appropriate action.
Components are for different purposes, well, to me.

I acknowledge that I can be wrong here. So, just IMHO.

All 4 comments

Care to ellaborate?

Probably referring to https://blog.nrwl.io/using-ngrx-4-to-manage-state-in-angular-applications-64e7a1f84b7b

Router as the Source of Truth
There are many ways to approach the synchronization of the @ngrx/Store and the router. One way is to build a generic library synchronizing the store with the router. It won鈥檛 solve all of the problems, but at least the synchronization won鈥檛 be ad-hoc. Another way is to make navigation part of updating the store. And finally we can make updating the store part of navigation. Which one should we pick?

The example app uses the router as a single source of truth for navigation already with router-store. Closing as non-actionable

ok, so in this example you use router in the container component. Now, this container component only purpose is to make router a single point of truth. I think the whole idea of making a component as a link between app and router is not right. I like the nrwl approach better - it's just an effect and there you just dispatch appropriate action.
Components are for different purposes, well, to me.

I acknowledge that I can be wrong here. So, just IMHO.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dollyshah-02-zz picture dollyshah-02-zz  路  3Comments

doender picture doender  路  3Comments

smorandi picture smorandi  路  3Comments

gperdomor picture gperdomor  路  3Comments

ghost picture ghost  路  3Comments