Skip to content

break up setRoute into separate methods? #11

@albertalquisola

Description

@albertalquisola

This is more of a usability enhancement vs. new feature but what do you think about breaking up the setRoute function into separate methods? I dislike how 'overloaded' it is. Depending on the params you pass in, the function will perform slightly different actions, making it hard to reason about and use.

RIght now, setRoute can be used in 4 different ways:

  1. setRoute(route)
  • navigate to new route
  1. setRoute(start, length)
  • remove a segment from the current route
  1. setRoute(index, value)
  • replace a segment of the current route
  1. setRoute(start, length, value)
  • remove and set a segment on the current route

Caveat is that this will introduce breaking changes to the router (I guess we could make it backwards compatible but not a huge fan of that idea)

Also, I'm willing to submit a PR for this if you think it's a good idea

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions