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

Notification when aborted -> retried transition completes #260

Open
sandstrom opened this issue Oct 2, 2018 · 0 comments
Open

Notification when aborted -> retried transition completes #260

sandstrom opened this issue Oct 2, 2018 · 0 comments

Comments

@sandstrom
Copy link
Contributor

sandstrom commented Oct 2, 2018

For regular transitions, using the then method on the returned Transition works well. When the transition is completed then callback is called.

With aborted + retried transitions it's trickier. Since retry creates a new transition (code below), it isn't possible to get notified when it resolves.

  1. Is this by design?
  2. If not, would it be possible to improve this?

Copying over the transition would work, but may break things (I don't know). Another option would be to introduce another method, something like retryableThen() on Promise, whose underlying promise would get copied over to retried transitions.

What are your thoughts? (cc: @asakusuma @chadhietala)

retry() {
    this.abort();
    let newTransition = this.router.transitionByIntent(this.intent as OpaqueIntent, false);

    // [...] shortened for clarity
    return newTransition;
  }

Source: https://github.com/tildeio/router.js/blob/c82c0ca1b7/lib/router/transition.ts#L273

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