Use new for-loop

This commit is contained in:
Henrik Giesel 2021-07-19 01:33:58 +02:00
parent eb4550d2d5
commit b3a7a4ac3d

View file

@ -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);