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

Add support for custom serializer and custom router state type #260

Open
Harpush opened this issue Jun 18, 2022 · 6 comments
Open

Add support for custom serializer and custom router state type #260

Harpush opened this issue Jun 18, 2022 · 6 comments
Labels
enhancement New feature or request polar This issue accepts pledges (funding) via Polar.sh.

Comments

@Harpush
Copy link

Harpush commented Jun 18, 2022

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

  • You can sponsor this specific effort via a Polar.sh pledge below
  • We receive 90% of the pledge once the issue is completed & verified
  • Polar receives 10% of the pledge as a fee
Fund with Polar
@LayZeeDK
Copy link
Member

Thank you for your feature request. What's a use case for this?

@LayZeeDK LayZeeDK added the enhancement New feature or request label Jun 18, 2022
@Harpush
Copy link
Author

Harpush commented Jun 18, 2022

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.

@LayZeeDK
Copy link
Member

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?

@Harpush
Copy link
Author

Harpush commented Jun 20, 2022

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.

@LayZeeDK
Copy link
Member

LayZeeDK commented Jun 21, 2022

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.

@LayZeeDK
Copy link
Member

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.

@LayZeeDK LayZeeDK added the polar This issue accepts pledges (funding) via Polar.sh. label Jul 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request polar This issue accepts pledges (funding) via Polar.sh.
Projects
None yet
Development

No branches or pull requests

2 participants