-
-
Notifications
You must be signed in to change notification settings - Fork 851
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calling enablePluginName() is not idempotent #692
Closed
3 tasks done
blixt opened this issue
Oct 27, 2020
· 1 comment
· Fixed by contrub/omm_playground#16, catalinateguiani/tv_series#13, knaylor/johnlagio#3, jngong/portfolio#8 or newerton/gostack-modulo07#1
Closed
3 tasks done
Calling enablePluginName() is not idempotent #692
blixt opened this issue
Oct 27, 2020
· 1 comment
· Fixed by contrub/omm_playground#16, catalinateguiani/tv_series#13, knaylor/johnlagio#3, jngong/portfolio#8 or newerton/gostack-modulo07#1
Labels
Comments
mweststrate
added a commit
that referenced
this issue
Nov 17, 2020
🎉 This issue has been resolved in version 7.0.15 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This was referenced Mar 7, 2021
This was referenced Mar 14, 2021
This was referenced Mar 16, 2021
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🐛 Bug Report
Calling
enableMapSet()
multiple times results in the work of adding Map and Set support being performed every time. It should only be performed the first time so that big codebases with multiple entrypoints and tests can safely call it in the parts of the code that knows the feature will be used, without having to worry about other parts of the codebase having already called it.Link to repro
https://codesandbox.io/s/immer-sandbox-forked-q2pu1?file=/src/index.ts
To Reproduce
Have a big codebase that may call
enableMapSet
in different modules that are used by different entrypoints, but it's very hard to predict in the entrypoint which modules will be used.Observed behavior
The Map and Set types of immer are patched every time
enableMapSet()
is called.Expected behavior
The second call to
enableMapSet()
should be a no-op.Environment
We only accept bug reports against the latest Immer version.
setUseProxies(true)
setUseProxies(false)
(ES5 only)The text was updated successfully, but these errors were encountered: