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

Add functionality for generating UrlRequests explicitly #52

Open
cacay opened this issue Nov 12, 2018 · 0 comments
Open

Add functionality for generating UrlRequests explicitly #52

cacay opened this issue Nov 12, 2018 · 0 comments

Comments

@cacay
Copy link

cacay commented Nov 12, 2018

Currently, a UrlRequest is generated when the user clicks on a link. There should be a function similar to Navigation.pushUrl except that it goes through application.onUrlRequest. This way, we can delegate to application.onUrlRequest from onClick and other handlers.

Here's my use case. I wrote a wrapper around Browser.application that, given the old URL and the new, decides whether to use pushUrl or replaceUrl. That way, all the logic of handling history is collected in one place instead of scattered across the application. This works fine for links, but not for handlers where I have to do the decision locally. Worse, since the old URL is maintained in the wrapper and not in the application, I can't implement this even if I'm OK with duplicating code.

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

1 participant