mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12: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(
|
function _runHook(
|
||||||
arr: Array<Callback>
|
hooks: Array<Callback>
|
||||||
): Promise<PromiseSettledResult<void | Promise<void>>[]> {
|
): Promise<PromiseSettledResult<void | Promise<void>>[]> {
|
||||||
const promises: (Promise<void> | void)[] = [];
|
const promises: (Promise<void> | void)[] = [];
|
||||||
|
|
||||||
for (let i = 0; i < arr.length; i++) {
|
for (const hook of hooks) {
|
||||||
try {
|
try {
|
||||||
const result = arr[i]();
|
const result = hook();
|
||||||
promises.push(result);
|
promises.push(result);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log("Hook failed: ", error);
|
console.log("Hook failed: ", error);
|
||||||
|
|
Loading…
Reference in a new issue