Skip to content

Transition resolve handler added by middleware runs after handler added by application  #155

Description

@blikblum

I have an middleware that attaches a resolve handler to transition using

transition.then(function(){
  setFlag
})

Then in application code

router.transitionTo('parent').then(function(){
  checkFlag
})

checkFlag will run before setFlag.

I hit this issue twice, one when i tried to set a property in router.state to be read after a transition and now when, inside middleware, i set active class for anchors according to href. These issues are showing in the tests and i could overcome them but i foresee actual use cases being affected also

It occurs because transitionTo/dispatch returns before running the middleware

Is there any way to the middleware be notified of the end of the transition before application code?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions