defer is like fn, but it waits for n SECONDS before executing
defer(durationInSeconds, fn)
Where fn is any operation
Seconds because ms is unlikely to be useful, and you can always to 0.1s. Usually JS timeouts are in ms so this might catch people out and we need to be very clear.
defer is like fn, but it waits for n SECONDS before executing
Where
fn
is any operationSeconds because ms is unlikely to be useful, and you can always to 0.1s. Usually JS timeouts are in ms so this might catch people out and we need to be very clear.
The implementation is like:
You can do this in job code today but it's a bit gnarly, and it feels like a useful pattern to support.
You can compose with
each
nicely: