diff options
author | Kitson Kelly <me@kitsonkelly.com> | 2018-10-15 07:29:50 +1100 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-10-14 17:38:23 -0400 |
commit | 10a97679ac80b4304c75d33cbc59c5736d11deb1 (patch) | |
tree | b51b9183ed251f61373069e5c4d35e39603bedb2 /js/timers.ts | |
parent | 1840a1971317f5b8fc6e322b3a414b7f8a593c88 (diff) |
Align JSDoc to style guide.
Diffstat (limited to 'js/timers.ts')
-rw-r--r-- | js/timers.ts | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/js/timers.ts b/js/timers.ts index 28de13d38..58367c1ea 100644 --- a/js/timers.ts +++ b/js/timers.ts @@ -197,6 +197,7 @@ function setTimer<Args extends Array<unknown>>( return timer.id; } +/** Sets a timer which executes a function once after the timer expires. */ export function setTimeout<Args extends Array<unknown>>( cb: (...args: Args) => void, delay: number, @@ -205,6 +206,7 @@ export function setTimeout<Args extends Array<unknown>>( return setTimer(cb, delay, args, false); } +/** Repeatedly calls a function , with a fixed time delay between each call. */ export function setInterval<Args extends Array<unknown>>( cb: (...args: Args) => void, delay: number, @@ -213,6 +215,7 @@ export function setInterval<Args extends Array<unknown>>( return setTimer(cb, delay, args, true); } +/** Clears a previously set timer by id. */ export function clearTimer(id: number): void { const timer = idMap.get(id); if (timer === undefined) { |