Skip to content

Commit 1ddda6c

Browse files
committed
Fix broken transpilation of map iteration in listener middleware
Same bug as be6e198 This appears to be some kind of issue with either ESBuild, TS, or both of them being used together. Replay of the bug: https://app.replay.io/recording/rtk-listener-middleware-not-updating--1bb6f325-3e75-4958-83b5-1d87719d4b6c
1 parent effab14 commit 1ddda6c

File tree

1 file changed

+3
-1
lines changed
  • packages/toolkit/src/listenerMiddleware

1 file changed

+3
-1
lines changed

packages/toolkit/src/listenerMiddleware/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,9 @@ export function createListenerMiddleware<
437437

438438
if (listenerMap.size > 0) {
439439
let currentState = api.getState()
440-
for (let entry of listenerMap.values()) {
440+
// Work around ESBuild+TS transpilation issue
441+
const listenerEntries = Array.from(listenerMap.values())
442+
for (let entry of listenerEntries) {
441443
let runListener = false
442444

443445
try {

0 commit comments

Comments
 (0)