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

[Discussion] Should the library, and in what level, support navigation cancellation by a controller? #2

Open
Bnaya opened this issue Jan 13, 2018 · 0 comments

Comments

@Bnaya
Copy link
Owner

Bnaya commented Jan 13, 2018

Example for possible implementation:

  async leave(): Promise<void | NavigationCanceled> {
    if (this.model.formDirty && !confirm("You have unsaved changes, are you sure you want to leave?")) {
      return new NavigationCanceled(/* insert any more info here */);
    }

    return;
  }

I'm afraid of miss-use and edge cases with cancelation.
We can tell the developer to make the validation himself before making the navigation

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

No branches or pull requests

1 participant