Web: implement WaitUntilStrategy (#3739)

This commit is contained in:
daxpedda
2024-06-20 23:07:42 +02:00
committed by Kirill Chibisov
parent a974640a66
commit d8f4d8f1b7
11 changed files with 226 additions and 14 deletions

View File

@@ -0,0 +1,10 @@
onmessage = event => {
const [port, timeout] = event.data
const f = () => port.postMessage(undefined)
if ('scheduler' in this) {
scheduler.postTask(f, { delay: timeout })
} else {
setTimeout(f, timeout)
}
}