mirror of
https://github.com/ankitects/anki.git
synced 2026-01-14 06:23:57 -05:00
Use new for-loop
This commit is contained in:
parent
07e07aa6da
commit
380ba8a5cc
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