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

Nested routes #1

Closed
ansarizafar opened this issue May 25, 2019 · 2 comments
Closed

Nested routes #1

ansarizafar opened this issue May 25, 2019 · 2 comments

Comments

@ansarizafar
Copy link

@lukeed Is it possible to use nested routes like vue router? If yes then could you please share an example?

@lukeed
Copy link
Owner

lukeed commented May 25, 2019

Don't have time for an example right now, but yes possible. That's what Navaid's base is for

With Navaid alone:

main = (
  navaid('/')
    .on('/users', () => 'load users app/component')
    //...
);

users = (
  navaid('/users')
    .on('/:id', params => {
      console.log(`do something with User if ID: ${params.id}`);
    })
    // ...
)

How you slice that up in your Svelte app is completely up to you. I'd personally keep it all inside App like this demo has done

@ansarizafar
Copy link
Author

Thanks for the sharing the code.

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

No branches or pull requests

2 participants