Skip to content

Commit

Permalink
function_ => callback
Browse files Browse the repository at this point in the history
  • Loading branch information
codykaup committed Sep 30, 2024
1 parent 8789a75 commit 7e28628
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions node-src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import picomatch, { Matcher } from 'picomatch';
export const lcfirst = (str: string) => `${str.charAt(0).toLowerCase()}${str.slice(1)}`;

export const delay = (ms: number) => new Promise<void>((resolve) => setTimeout(resolve, ms));
export const tick = async (times: number, interval: number, function_: (index: number) => any) => {
export const tick = async (times: number, interval: number, callback: (index: number) => any) => {
for (let index = 0; index < times; index += 1) {
await delay(interval);
function_(index);
callback(index);
}
};

Expand Down

0 comments on commit 7e28628

Please sign in to comment.