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

Add a Type argument to route so that the dynamic segment / parameter names can also be intellisensed #3

Open
NullVoxPopuli opened this issue Apr 18, 2019 · 0 comments

Comments

@NullVoxPopuli
Copy link
Owner

NullVoxPopuli commented Apr 18, 2019

proposed api:

 const tree = route({
      blogs: route('blogs', {
        show: route<{ blog_id: number }>(':blog_id', {
          edit: route('edit'),
          posts: route('posts', {
            show: route<{ post_id: string }>(':post_id'),
            edit: route<{ post_id: string }>(':post_id/edit'),
          }),
        }),
      }),
    });

tree.blogs.show.posts.edit.with({ 
  /* TS should complain if blog_id and post_id are not present */ 
});

Once this is added, we can cut a 1.0 release

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

1 participant