Skip to content

Commit bbb3f22

Browse files
EskiMojo14phryneas
andauthored
use flatMap instead of for loop
Co-authored-by: Lenz Weber-Tronic <mail@lenzw.de>
1 parent 9376ac8 commit bbb3f22

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

packages/toolkit/src/matchers.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -361,11 +361,5 @@ export function isAsyncThunkAction<
361361
return isAsyncThunkAction()(asyncThunks[0])
362362
}
363363

364-
const matchers: Matcher<any>[] = []
365-
366-
for (const asyncThunk of asyncThunks) {
367-
matchers.push(asyncThunk.pending, asyncThunk.rejected, asyncThunk.fulfilled)
368-
}
369-
370-
return isAnyOf(...matchers)
364+
return isAnyOf(...asyncThunks.flatMap(asyncThunk => [asyncThunk.pending, asyncThunk.rejected, asyncThunk.fulfilled]))
371365
}

0 commit comments

Comments
 (0)