From 35edc77a9ac84adc02fd696962c9bbd8b6ca4c8d Mon Sep 17 00:00:00 2001 From: Ben Allfree Date: Sat, 29 Jun 2024 14:21:21 -0700 Subject: [PATCH] feat(pockethost): sequential execution of actions --- .changeset/clean-rockets-mate.md | 5 +++++ packages/pockethost/src/common/plugin/action.ts | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .changeset/clean-rockets-mate.md diff --git a/.changeset/clean-rockets-mate.md b/.changeset/clean-rockets-mate.md new file mode 100644 index 00000000..2c180746 --- /dev/null +++ b/.changeset/clean-rockets-mate.md @@ -0,0 +1,5 @@ +--- +'pockethost': minor +--- + +Enhancement: actions execute sequentially diff --git a/packages/pockethost/src/common/plugin/action.ts b/packages/pockethost/src/common/plugin/action.ts index ebe6a8da..0f67d1b6 100644 --- a/packages/pockethost/src/common/plugin/action.ts +++ b/packages/pockethost/src/common/plugin/action.ts @@ -66,7 +66,9 @@ async function action(actionName: string, context: any) { } const action = actions[actionName] if (!action) return false - await Promise.all(action.map((handler) => handler(context))) + for (const { handler } of action) { + await handler(context) + } return true }