From 922bc322df4fc9a56bb57f84052603d659ebfa3d Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 10 Jul 2026 20:40:34 +0000 Subject: [PATCH] perf: optimize pending subscriber iteration using for...of loop Co-authored-by: johnstrand <11484777+johnstrand@users.noreply.github.com> --- src/Squawk.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Squawk.ts b/src/Squawk.ts index 0355076..584e683 100644 --- a/src/Squawk.ts +++ b/src/Squawk.ts @@ -277,7 +277,9 @@ export default function createStore(initialState: Required, useReduxDevToo // Invoke all unique subscribers with the new pending states if (pendingSubscribersInternal.size > 0) { const currentPendingState = pendingState.get(); - pendingSubscribersInternal.forEach((subscriber) => subscriber(currentPendingState)); + for (const subscriber of pendingSubscribersInternal) { + subscriber(currentPendingState); + } } }, /** Sets up a subscription for a single global state context */