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

Allow chaining of Router.addRoute() calls #37

Open
kaero opened this issue Oct 27, 2014 · 2 comments
Open

Allow chaining of Router.addRoute() calls #37

kaero opened this issue Oct 27, 2014 · 2 comments

Comments

@kaero
Copy link
Contributor

kaero commented Oct 27, 2014

Existing interface is a bit annoying when writing new router:

router.addRoute({
  ...
});

router.addRoute({
  ...
});

// +100500 route.addRoute calls

I suppose to return router instance from addRoute to allow chaining:

router
    .addRoute({
     ...
    })
    .addRoute({
      ...
    });

Only a bit of sugar, no anything more..

@miripiruni
Copy link
Member

+1

@ruslankerimov
Copy link
Member

May be add new method: pushRoute, appendRoute or ...
Because returning an instance of created route can be useful and I don't want to break backwards compatibility.

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

No branches or pull requests

3 participants