Next.js website for Rocky Mountain Vending company featuring: - Product catalog with Stripe integration - Service areas and parts pages - Admin dashboard with Clerk authentication - SEO optimized pages with JSON-LD structured data Co-authored-by: Cursor <cursoragent@cursor.com>
17 lines
531 B
Text
17 lines
531 B
Text
import {Timer, now} from "./timer.js";
|
|
|
|
export default function(callback, delay, time) {
|
|
var t = new Timer, total = delay;
|
|
if (delay == null) return t.restart(callback, delay, time), t;
|
|
t._restart = t.restart;
|
|
t.restart = function(callback, delay, time) {
|
|
delay = +delay, time = time == null ? now() : +time;
|
|
t._restart(function tick(elapsed) {
|
|
elapsed += total;
|
|
t._restart(tick, total += delay, time);
|
|
callback(elapsed);
|
|
}, delay, time);
|
|
}
|
|
t.restart(callback, delay, time);
|
|
return t;
|
|
}
|