Skip to content
This repository was archived by the owner on Jan 29, 2026. It is now read-only.
This repository was archived by the owner on Jan 29, 2026. It is now read-only.

Use of 'return' inside of 'finally' callbacks #122

@thorn0

Description

@thorn0

I'm trying to tackle an issue in my project with impossibility to reload the state and constantly getting Transition defered by another call to goto. I can't isolate it so far. However, I started looking into the code of the router and came across a probable reason.

See this line: state.ts, line 678. The finally method is used here apparently with an assumption that returning a value from it has some effect. However, the docs state (emphasis mine) the opposite:

finally(callback) – allows you to observe either the fulfillment or rejection of a promise, but to do so without modifying the final value. This is useful to release resources or do some clean-up that needs to be done whether the promise was rejected or resolved. See the full specification for more information.

Thus there is no point in assignment like gotoPromise = gotoPromise.finally(...). It does nothing. The same with: gotoPromise.finally(function() { /*...*/ return ...; }). This return is useless, the returned value goes to nowhere.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions