@anio-js-foundation/run-fn-periodically
v1.0.0
Published
Run a function periodically.
Downloads
2
Readme
@anio-js-foundation/run-fn-periodically
Run a function periodically.
import runFnPeriodically from "@anio-js-foundation/run-fn-periodically"
const loop = runFnPeriodically(async () => {
console.log("hello from loop")
await (new Promise(resolve => setTimeout(resolve, 500)))
}, 1000)
setTimeout(() => {
loop.cancel()
}, 10)