-
Notifications
You must be signed in to change notification settings - Fork 26
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
Explainer for manual commit #259
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with editorial nits!
README.md
Outdated
|
||
If a handler passed to `intercept()` rejects before `e.commit()` is called, then the navigation will be treated as canceled (both `committed` and `finished` promises will reject, and no url update will occur). If a handler passed to `intercept()` rejects after `e.commit()` is called, the behavior will match a rejected promise in immediate commit mode (i.e., the `committed` promise will fulfill, the `finished` promise will reject, and the url will update). | ||
|
||
Because manual commit can be used to cancel the navigation before the url updates, it is only available when `e.cancelable` is true. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because manual commit can be used to cancel the navigation before the url updates, it is only available when `e.cancelable` is true. | |
Because manual commit can be used to cancel the navigation before the URL updates, it is only available when `e.cancelable` is true. See [above](#restrictions-on-firing-canceling-and-responding) for details on when `e.cancelable` is set to false, and thus manual commit is not available. |
Also state what will happen if you try to use manual commit when e.cancelable
is false. An exception, I assume.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't finalized that. My draft does a console warning (on the logic that it's better to invalidate the commit option, rather than invalidate the entire intercept). Is it ok to leave that ambiguous in the explainer (since we don't really enumerate every possible exception in other parts of the API)?
Co-authored-by: Domenic Denicola <[email protected]>
No description provided.