aleph1-delayed-set-interval is a JS library that delay the setInterval function to the start of the next minute.
yarn add aleph1-delayed-set-interval
or
npm install aleph1-delayed-set-interval
import the library using
import { delayInterval, DelayedIntervalHandler} from "aleph1-delayed-set-interval";
/* set a funcrion to run every 3 seconds - starting from the start of the next minute. */
const handler: DelayedIntervalHandler = delayInterval( ()=>{ console.log("Hello"); }, 3000);
/* then sometime later */
handler.dispose();
git clone https://github.com/avrahamcool/aleph1-delayed-set-interval.git
cd aleph1-delayed-set-interval/
yarn
run yarn build
or npm build
to compile the entire project.
The code is open source and available under the MIT License.
Built and maintained by Essoudry Avraham