donavon/use-interval

useInterval with driftless

Opened this issue · 2 comments

Hi! Would you be interested in a PR to optionally pass custom setInterval and clearInterval functions? I'd like to use this with driftless for better precision over time.

Sounds cool to me! As long as it works! Is there any performance loss?

Driftless is surely a little less performant than native, though the developer can choose this tradeoff when more precision is important. In the case of use-interval, using something like driftless would be opt-in, so there is no performance loss unless a developer chooses it.