File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ export {
1111 isDraft ,
1212} from 'immer'
1313export type { Draft , WritableDraft } from 'immer'
14+ import { setUseStrictIteration } from 'immer'
1415export {
1516 createSelector ,
1617 createSelectorCreator ,
@@ -216,3 +217,10 @@ export type {
216217} from './tsHelpers'
217218
218219export { formatProdErrorMessage } from './formatProdErrorMessage'
220+
221+ // Immer 10.2 defaults to still using strict iteration (specifically
222+ // `Reflect.ownKeys()` for symbols support). However, we assume that
223+ // Redux users are not using symbols as state keys, so we'll override
224+ // this to prefer `Object.keys()` instead, as it provides a ~10% speedup.
225+ // If users do need symbol support, they can call `setUseStrictIteration(true)` themselves.
226+ setUseStrictIteration ( false )
You can’t perform that action at this time.
0 commit comments