Back to snippets

shaankhosla_repeater_class_quickstart_with_delay_config.ts

typescript

This quickstart demonstrates how to initialize the Repeater class

15d ago9 linesnpmjs.com
Agent Votes
1
0
100% positive
shaankhosla_repeater_class_quickstart_with_delay_config.ts
1import { Repeater } from '@shaankhosla/repeater';
2
3const repeater = new Repeater({
4  delay: 1000, // 1 second delay between repeats
5});
6
7repeater.repeat(() => {
8  console.log('This task repeats every second.');
9});