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