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 Store: Update stateKey definition to take a string or selector #1300

Closed
brandonroberts opened this issue Aug 27, 2018 · 5 comments · Fixed by TypescriptID/platform#143
Labels
Accepting PRs community watch Someone from the community is working this issue/PR enhancement Project: Router Store

Comments

@brandonroberts
Copy link
Member

brandonroberts commented Aug 27, 2018

Describe any alternatives/workarounds you're currently using

Other information:

If accepted, I would be willing to submit a PR for this feature

[ ] Yes (Assistance is provided if you need help submitting a pull request)
[ ] No

Follow-up to #1294. Allows more flexibility about where you want to place your router state in your state object. Leave a comment if you are willing to take on this PR.

@koumatsumoto
Copy link
Contributor

@brandonroberts
you mean we change StoreRouterConfig interface as below?

before

export interface StoreRouterConfig {
  stateKey?: string;
  serializer?: new (...args: any[]) => RouterStateSerializer;
  navigationActionTiming?: NavigationActionTiming;
}

after

export interface StoreRouterConfig {
  stateKeyOrSelector: string | Selector;
  serializer?: new (...args: any[]) => RouterStateSerializer;
  navigationActionTiming?: NavigationActionTiming;
}

@brandonroberts
Copy link
Member Author

Yes, and add a test also

@koumatsumoto
Copy link
Contributor

Thank you!
I'd like to take this issue if I could.

@brandonroberts
Copy link
Member Author

👍

@homj
Copy link

homj commented Dec 8, 2018

I think the SoreRouterConfig (and the Selector proposed here) should be generic to prevent type warnings when using custom serializers (see #1457)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepting PRs community watch Someone from the community is working this issue/PR enhancement Project: Router Store
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants