@anio-js-foundation/run-fn-periodically

1.0.0 • Public • Published

@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)

Readme

Keywords

none

Package Sidebar

Install

npm i @anio-js-foundation/run-fn-periodically

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

1.67 kB

Total Files

3

Last publish

Collaborators

  • exory2024
  • dasdeo