Skip to content

Added support for parsed routes #19

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

Closed
wants to merge 1 commit into from
Closed

Added support for parsed routes #19

wants to merge 1 commit into from

Conversation

HristoKolev
Copy link

The current behavior is that you have this state:

{
  location: '/lazy/0;opt1=15?query1=42'
}

and you have to parse it manually and retrieve the parameters. Also you don't have access to data that is resolved via Resolve Guards.

I added support for parsing of all route data and the same state looks like this:

 {
    router: {
        params: {
            id: '0',
            opt1: '15',
        },
        queryParams: {
            query1: '42',
        },
        data: { resolvedData1: 'some data' },
        location: '/lazy/0;opt1=15?query1=42',
    },
}

I didn't remove the location property, just added all of the parsed data that I can get my hand on from the route snapshot.

What I didn't do:

You can still dispatch actions with the location property and it will update the router, but you can't dispatch actions that update parameters or resolved data. I may try to implement that in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant