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

Should be able to replace current route without history entry #47

Closed
Infeligo opened this issue Dec 29, 2015 · 5 comments
Closed

Should be able to replace current route without history entry #47

Infeligo opened this issue Dec 29, 2015 · 5 comments

Comments

@Infeligo
Copy link

History API provides two methods for updating state: pushState and replaceState. The latter is used when there is no intention to create a new history entry. There are realistic use cases for this. Other frameworks that have routing provide such method (e.g. Backbone and Mithril). Is it possible to add such option to Riot?

@cognitom
Copy link
Member

cognitom commented Jan 9, 2016

I'm implementing this feature on dev branch:

shouldReplace
  ? hist.replaceState(null, title, path)
  : hist.pushState(null, title, path)

Usage:

var replaceFlag = true
route('path/to', 'Page Title', replaceFlag)

But, I couldn't make a test for it, because PhantomJS (1.9) doesn't support history.back()...
Is there any good idea?

cognitom added a commit that referenced this issue Jan 9, 2016
@cognitom cognitom mentioned this issue Jan 9, 2016
4 tasks
@cognitom
Copy link
Member

@GianlucaGuarini any idea about testing this? I've been trying to move to PhantomJS 2.0, but there're other difficulties...
Protractor could be another option?

@GianlucaGuarini
Copy link
Member

@cognitom you can run the tests using our browserstack account

@cognitom
Copy link
Member

Oh, thanks. I've almost forgot about that. I'll have a try ;)

@cognitom
Copy link
Member

@Infeligo we can use this feature from riot-route@2.3.15 or riot@2.3.13 :-)

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

3 participants