Closed
Description
Mithril version: v2.0.4 (not new, though)
Browser and OS: All
Project:
Code
const Comp = {
view: () => m("div"),
onbeforeremove: () => {
then(resolve, reject) {
resolve(delay(100))
},
},
}
function delay(ms) {
return new Promise(resolve => { setTimeout(resolve, ms) })
}
Steps to Reproduce
Expected Behavior
It to operate asynchronously
Current Behavior
It doesn't wait.
Context
We're not honoring the Promises/A+ spec here. And fixing this is as simple as changing these two lines to wrap their this
value with Promise.resolve(...)
.
Metadata
Metadata
Assignees
Type
Projects
Status
Closed