react-timing-hooks icon indicating copy to clipboard operation
react-timing-hooks copied to clipboard

"Leading" option for intervals

Open EricLambrecht opened this issue 1 year ago • 0 comments

Status Quo / Problem / Topic By default, Javascript intervals do not call their callbacks on creation/startup, but only after the first cycle/timeout. There might be cases where this would be useful, though. Internally this package has such a use-case for example (iirc).

Solution A leading option could allow executing the provided callback immediately upon start() (or mount if options.startOnMount=true).

EricLambrecht avatar Aug 04 '24 12:08 EricLambrecht