UNPKG

bookie-d3-timer

Version:

An efficient queue capable of managing thousands of concurrent animations.

12 lines (10 loc) 261 B
import {Timer} from "./timer"; export default function(callback, delay, time) { var t = new Timer; delay = delay == null ? 0 : +delay; t.restart(function(elapsed) { t.stop(); callback(elapsed + delay); }, delay, time); return t; }