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

Create a TS interface for VaadinRouterView #422

Closed
haijian-vaadin opened this issue Jan 3, 2020 · 1 comment
Closed

Create a TS interface for VaadinRouterView #422

haijian-vaadin opened this issue Jan 3, 2020 · 1 comment
Assignees
Labels

Comments

@haijian-vaadin
Copy link
Contributor

haijian-vaadin commented Jan 3, 2020

When implementing client-side navigation callbacks, onBeforeEnter, onBeforeLeave, etc, I want to have autocomplete and type safety, so that I don't make typos.

DoD:
Create a TS interface VaadinRouterView that collects all life cycle callbacks.

A ts view would implement this interface to get the callbacks

class MyView extends HTMLElement implements VaadinRouterView{
  onBeforeEnter(location, commands, router) {
    return location.pathname === '/cancel' ? commands.prevent() : {};
  }
}
@vlukashov
Copy link

Looks related to #404. Perhaps, when implementing this issue we need to take into account the use case described in the other issues as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants