File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 11import type { Draft } from 'immer'
2- import { produce as createNextState , isDraft , isDraftable } from 'immer'
2+ import {
3+ produce as createNextState ,
4+ isDraft ,
5+ isDraftable ,
6+ setUseStrictIteration ,
7+ } from 'immer'
38import type { Action , Reducer , UnknownAction } from 'redux'
49import type { ActionReducerMapBuilder } from './mapBuilders'
510import { executeReducerBuilderCallback } from './mapBuilders'
611import type { NoInfer , TypeGuard } from './tsHelpers'
712import { freezeDraftable } from './utils'
813
14+ // Immer 10.2 defaults to still using strict iteration (specifically
15+ // `Reflect.ownKeys()` for symbols support). However, we assume that
16+ // Redux users are not using symbols as state keys, so we'll override
17+ // this to prefer `Object.keys()` instead, as it provides a ~10% speedup.
18+ // If users do need symbol support, they can call `setUseStrictIteration(true)` themselves.
19+ setUseStrictIteration ( false )
20+
921/**
1022 * Defines a mapping from action types to corresponding action object shapes.
1123 *
You can’t perform that action at this time.
0 commit comments