Skip to content

Commit 972801e

Browse files
yuanjackie1MarkTeetsjasnoominzo-kim
committed
changes in throttle.ts and masterState.tsx for TS
Co-authored-by: Mark Teets <[email protected]> Co-authored-by: Jasmine <[email protected]> Co-authored-by: Minzo Kim <[email protected]>
1 parent e566941 commit 972801e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/backend/controllers/throttle.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* @returns A function that limits input function, `callback`, from being called more than once every `MIN_TIME_BETWEEN_UPDATE` milliseconds
66
*
77
*/
8-
export default function throttle<T extends (...args: any) => any>(
8+
export default function throttle<T extends (...args: Parameters<T>[]) => any>(
99
callback: T,
1010
MIN_TIME_BETWEEN_UPDATE: number,
1111
): (...arg: Parameters<T>) => ReturnType<T> {
@@ -19,7 +19,7 @@ export default function throttle<T extends (...args: any) => any>(
1919
*
2020
* @default false
2121
*/
22-
let isOnCooldown = false;
22+
let isOnCooldown: boolean = false;
2323
/**
2424
* A boolean variable tracking if there is a request to invoke the callback in the queue.
2525
*
@@ -30,7 +30,7 @@ export default function throttle<T extends (...args: any) => any>(
3030
* @default false
3131
*
3232
*/
33-
let isCallQueued = false;
33+
let isCallQueued: boolean = false;
3434

3535
let timeout: NodeJS.Timeout;
3636
// Wrap the passed-in function callback in a callback function that "throttles" (puts a limit on) the number of calls that can be made to function in a given period of time (ms)

src/backend/models/masterState.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default {
1010
/**
1111
* @function clear - Clears componentActionsRecord
1212
*/
13-
clear: () => {
13+
clear: (): void => {
1414
componentActionsRecord = [];
1515
},
1616

0 commit comments

Comments
 (0)