Open Harpush opened 2 years ago
Thank you for your feature request. What's a use case for this?
Currently the used serializer is always MinimalRouterStateSerializer
. Sometimes you wish to provide your own serializer as seen in the official router store. Mostly for custom route data aggregations.
I'm not very familiar with @ngrx/router-store
but from what I can read, a router state serializer is used to extract more slices of state from RouterStateSnapshot
, correct?
Indeed. It's used to allow the user to add more or less state slices to the router state. It can be used to aggreagte data across the route tree and omit unwnated data.
I'm not sure how adding this is better than subscribing to the RouterState
through the Router
and mapping using observable operators. That seems to be a lot easier than implementing a router serializer.
In NgRx RouterStore this functionality was added to support Redux Dev Tools. Currently, NgRx ComponentStore doesn't have native support for Redux Dev Tools.
Even if we were to add it, I worry it would increase the bundle size significantly even for the xx% of applications never using this feature.
The current ngrx router-store supports provofing a custom state serializer and working with a custom state type. router-component-store should support this too.
Funding