You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Is this by design?
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.
retry(){this.abort();letnewTransition=this.router.transitionByIntent(this.intentasOpaqueIntent,false);// [...] shortened for clarityreturnnewTransition;}
For regular transitions, using the
then
method on the returnedTransition
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.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()
onPromise
, whose underlying promise would get copied over to retried transitions.What are your thoughts? (cc: @asakusuma @chadhietala)
Source: https://github.com/tildeio/router.js/blob/c82c0ca1b7/lib/router/transition.ts#L273
The text was updated successfully, but these errors were encountered: