A drop in replacement for elm/core's Process.sleep.
The JavaScript runner has this task builtin by default. If needed it can be overridden like so:
NOTE: The custom example is the same as the built-in implementation.
import * as ConcurrentTask from "@andrewmacmurray/elm-concurrent-task"
ConcurrentTask.register({
tasks: {},
ports: app.ports,
builtins: {
sleep: customSleep
}
});
function customSleep(ms: number): Promise<void> {
return new Promise((resolve) => setTimeout(resolve, ms));
}
Wait for a number of milliseconds before continuing with the next Task.
A direct replacement for
elm/core'sProcess.sleep.