feat(router-store): add createRouterSelector to select router data for default config #3103
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Closes #
What is the new behavior?
Does this PR introduce a breaking change?
Other information
This is an RFC to make it easier to select the router state when the default router config is used.
Because the router store module is opinionated and uses
router
as the default feature name, I was thinking about adding a bit of default behavior to the current router selectors. This aims to make it easier to get started with using the router store.When the default config is used, I think we can:
getSelectors
smarter and to use the default router state selector to retrieve the router stateI started this PR to promote and use the
DEFAULT_ROUTER_FEATURENAME
(instead of the "magicrouter
" string) constant in the example app and the docs. But then I continued to make the selectors more opinionated, because this is how I've been and seen using it in all the projects.