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

Router-state plugin #23

Closed
filipjnc opened this issue Jul 27, 2018 · 4 comments
Closed

Router-state plugin #23

filipjnc opened this issue Jul 27, 2018 · 4 comments
Assignees
Labels
accepts PR enhancement New feature or request

Comments

@filipjnc
Copy link

filipjnc commented Jul 27, 2018

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ ] Performance issue
[x] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

What is the motivation / use case for changing the behavior?

I am considering Akita for a fairly complex app and I seem to miss just a single puzzle piece in migrating from ngrx/ngxs - the router state. This plugin would address two important use cases in my view:

  1. Memoized selectors based on route params and queryParams (e.g. active entity based on id param)
  2. Time travel with Redux DevTools & overall transparency while debugging (Router_Navigate, Router_Cancel, etc.)

Would it fit well in Akita's infrastructure?

@NetanelBasal NetanelBasal added the enhancement New feature or request label Jul 28, 2018
@NetanelBasal
Copy link
Collaborator

It seems like a good idea. Will need to investigate it.

@filipjnc
Copy link
Author

@NetanelBasal A rough idea how I synchronized the router with the router-state:
https://stackblitz.com/edit/akita-todos-app-ge8rcp?file=src%2Fapp%2Frouter%2Frouter.service.ts

It's just a quick dirty implementation and there are many things open:

  1. Navigation Cancel and Navigation Error: only the methods with custom actions are there, I got to figure out how to update the state in each case
  2. The ability to provide a custom router serializer: the plugin would need to provide some interfaces/abstract classes to implement
  3. Transform to plugin 😃

@NetanelBasal
Copy link
Collaborator

Looks like a good start. My colleague @shaharkazaz also started to investigate this. I migrated the code to an application with routing so you can test it.

https://stackblitz.com/edit/angular-router-basic-example-agvggd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepts PR enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants