Skip to content

Commit

Permalink
💫 Update: Ex - Helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
dominicstop committed Apr 22, 2023
1 parent 0444541 commit 1289e81
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions example/src/functions/Helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,7 @@ export function promiseWithTimeout<T>(ms: number, promise: Promise<T>) {
export function pad(num: number | string, places = 2) {
return String(num).padStart(places, '0');
}

export function getNextItemInCyclicArray<T>(index: number, array: Array<T>): T {
return array[index % array.length];
}

0 comments on commit 1289e81

Please sign in to comment.