mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
Use new for-loop
This commit is contained in:
parent
eb4550d2d5
commit
b3a7a4ac3d
1 changed files with 3 additions and 3 deletions
|
@ -28,13 +28,13 @@ export function getTypedAnswer(): string | null {
|
|||
}
|
||||
|
||||
function _runHook(
|
||||
arr: Array<Callback>
|
||||
hooks: Array<Callback>
|
||||
): Promise<PromiseSettledResult<void | Promise<void>>[]> {
|
||||
const promises: (Promise<void> | void)[] = [];
|
||||
|
||||
for (let i = 0; i < arr.length; i++) {
|
||||
for (const hook of hooks) {
|
||||
try {
|
||||
const result = arr[i]();
|
||||
const result = hook();
|
||||
promises.push(result);
|
||||
} catch (error) {
|
||||
console.log("Hook failed: ", error);
|
||||
|
|
Loading…
Reference in a new issue