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

Feature request: Add a way to add url hash fragments to pages when visiting via #463

tomdcc opened this issue Dec 23, 2016 · 2 comments


Copy link

@tomdcc tomdcc commented Dec 23, 2016

We have a SPA that keeps some state in the browser hash, e.g.

I just hit a case of wanting to visit a page with some state pre-specified in the URL, but found that there's no way to do this using the normal pattern. The fallback is to construct the page url manually and then use browser.go(theUrl);, but this is a bit ugly.

This could take the form of duplicated to() / via() methods with an extra param on the end for the hash. One annoyance is that it would read weirdly, since the params map is currently the last one:, [subpath], 'hashfoo=bar', param: 'baz')

Alternatively, the new form could force API consumers to just put their params in a map in the natural order, which would make readability a bit better, [subpath], [param: 'baz'], 'hashfoo=bar')

A different approach could be to use a magic key and pass the hash as a param:, [subpath], param: 'baz', (Browser.HASH): 'hashfoo=bar')

Another thing to consider would be allowing the hash to be specified as a map, as this is quite common for SPAs:, [subpath], [param: 'baz'], [hashfoo: 'bar'])

Copy link

@erdi erdi commented Dec 23, 2016

@erdi erdi closed this in d48ffc7 Dec 29, 2016
Copy link

@erdi erdi commented Dec 29, 2016

Hopefully that's what you were after, @tomdcc.

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

Successfully merging a pull request may close this issue.

None yet
2 participants