Open ArtskydJ opened 2 years ago
So ASR was originally written in the error-first callback style, and didn't support promises. Promise support was added later.
To maintain backwards compatibility, the callback style is still supported. The way that works is that if the resolve
function returns a thenable, ASR internally resolves with the result of that thenable. Otherwise, it expects that the user plans to call the callback function in the future.
At this point I'm fine with publishing the breaking change that removes support for callback functions and only exposes the promise API. Callbacks have been dead for a long time.
I put some test data in the resolve, and forgot to set it as an async function. When I try to load a route, I don't get any error message or anything. It just appears to get stuck.
I would have expected it to either work as-is, or to throw an error about a missing
.then
method.