-
Notifications
You must be signed in to change notification settings - Fork 3
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
replaceRoute API support request? #9
Comments
Fair enough. Would you be interested in making a PR? |
Potentially. However, I'm not overly familiar with how to replicate this behavior in legacy browsers (browsers that dont support window history API) |
I went ahead and wrote a quick implementation for |
That shouldn't be necessary, if you go to the Pull Requests page in this repo, you can click "New pull request" and select your own fork. |
cool, thats fine. just submitted a PR. This is more a proof of concept. If you like the approach, I can refine/refactor a bit more and add test cases |
Any chance we can get support for a call that looks something like this?
Under the hood, director is using
window.pushState()
on therouter.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 toexample.com/home
instead.Also, this has been requested by a few of people:
flatiron#316
The text was updated successfully, but these errors were encountered: