Skip to content

replaceRoute API support request? #9

Description

@albertalquisola

Any chance we can get support for a call that looks something like this?

// does not add an entry into the browser history
router.replaceRoute('/new/route');

Under the hood, director is using window.pushState() on the router.setRoute() call which will push a new entry onto the window history stack. This makes the native browser history inflexible in certain cases.

eg. if i only want to change query params (user isn't taken to new page)
previous url: example.com/home
current url: example.com/new/route
router.setRoute('/new/route?new=true');

Now, if the user clicks back button, they'll be taken to example.com/new/route which is the same page sans any query param filter. I would like the control to navigate them back to example.com/home instead.

Also, this has been requested by a few of people:
flatiron#316

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions