• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mweststrate / immer
98%
master: 99%

Build:
Build:
LAST BUILD BRANCH: github-actions-ci
DEFAULT BRANCH: master
Repo Added 08 Jan 2018 08:16PM UTC
Files 17
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

LAST BUILD ON BRANCH v5.0.0
branch: v5.0.0
CHANGE BRANCH
x
Reset
  • v5.0.0
  • 0.4.0
  • 1.0.0
  • aleclarson
  • async-recipes
  • ci
  • ci/test-nodejs-6-8-10-11
  • ci/use-yarn-cache
  • code-cleanup
  • curry
  • curry2
  • deep-freeze
  • dependabot/npm_and_yarn/handlebars-4.5.1
  • dependabot/npm_and_yarn/js-yaml-3.13.1
  • dependabot/npm_and_yarn/lodash-4.17.13
  • dependabot/npm_and_yarn/mixin-deep-1.3.2
  • docs
  • enable-codesandbox
  • es5-dts
  • factory
  • feature/curry
  • feature/fast-prune
  • feature/reuse
  • fix-362
  • fix-map-instantiation
  • fix/es5-array-delete-error
  • frozen-return
  • funding
  • github-actions-ci
  • hooks
  • immer3
  • immer3-v2
  • improved-types
  • isDraft
  • issue-100
  • issue-202
  • issue-233
  • issue-243
  • issue-264
  • issue-268
  • issue-270
  • issue-328
  • issue-381
  • jest24
  • kachkaev-add-failing-tests-for-recursive-use
  • map-fixes
  • master
  • new-immer-readme-image
  • next
  • nothing
  • patch-1
  • patch-2
  • patch-fixes
  • patch2
  • patches
  • perf3
  • produce-with-patches
  • promise
  • pull/351/head
  • seamless-immutable
  • sucrase
  • support_map_and_set
  • symbols
  • ts
  • ts-3.4
  • ts-3.4-inference-improvements
  • ts-jest
  • v0.3.0
  • v0.4.2
  • v0.5.0
  • v0.6.0
  • v0.8.2
  • v1.1.0
  • v1.1.1
  • v1.1.2
  • v1.1.3
  • v1.10.0
  • v1.10.1
  • v1.10.2
  • v1.10.3
  • v1.10.4
  • v1.10.5
  • v1.11.0
  • v1.11.1
  • v1.12.0
  • v1.12.1
  • v1.2.0
  • v1.4.0
  • v1.5.0
  • v1.7.0
  • v1.7.1
  • v1.7.3
  • v1.7.4
  • v1.8
  • v1.8.0
  • v1.8.0-alpha
  • v1.8.1
  • v1.8.2
  • v1.9
  • v1.9.0
  • v1.9.1
  • v1.9.2
  • v1.9.3
  • v2
  • v2.0.0
  • v2.0.0-alpha
  • v2.1.0
  • v2.1.1
  • v2.1.2
  • v2.1.3
  • v2.1.4
  • v2.1.5
  • v2.2.0
  • v3.0.0
  • v3.1
  • v3.1.0
  • v3.1.1
  • v3.1.2
  • v3.1.3
  • v3.1.4
  • v3.2.0
  • v3.2.1
  • v3.3.0
  • v4
  • v4.0.0
  • v4.0.1
  • v4.0.2
  • v5.0.1
  • v5.0.2
  • v5.1.0
  • v5.2.0
  • v5.2.1
  • v5.3.0
  • v5.3.1
  • v5.3.2
  • v5.3.3
  • visited

pending completion
1047

push

travis-ci

GitHub
feat: added first class support for `Map` and `Set`

BREAKING CHANGE: Maps and Sets are treated differently now; they will no longer directly mutated when updated inside a draft

This release introduces first class support for Maps and Sets! 
Some things to keep in mind:

* Inside recipes, you can directly modify Maps and Sets with methods like `add`, `set`, `delete` and `clear`
* Those methods do mutate draft Maps and Sets, but won't actually change their originals!
* Immer does not polyfill Map and Set automatically in environments where those aren't available out of the box
* Maps and Sets are supported both in ES5 and Proxy mode
* If `autoFreeze` is enabled, the maps and sets returned from a producer will be artificially frozen by making their mutative APIs unusable
* Non primitive keys for Maps, and non primitive values for Sets are supported. However, we strongly recommend to not combine non-primitive keys to Maps with patches, for reasons expressed below. 

Open questions
* TypeScript support for storing immutable types inside Maps and Sets, and converting them to `Draft`'s, is limited, see #448 for details
* Since JSON-patch standard doesn't offer support for Sets or Maps, it is not entirely clear how mutations to those are best described by patches, so this might be refined in the future. See also #450  

Credits to @runnez, @aigoncharov  and @aleclarson for making this happen!

533 of 555 branches covered (96.04%)

Branch coverage included in aggregate %.

723 of 728 relevant lines covered (99.31%)

671.73 hits per line

Relevant lines Covered
Build:
Build:
728 RELEVANT LINES 723 COVERED LINES
671.73 HITS PER LINE
Source Files on v5.0.0
  • List 0
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
1047 v5.0.0 feat: added first class support for `Map` and `Set` BREAKING CHANGE: Maps and Sets are treated differently now; they will no longer directly mutated when updated inside a draft This release introduces first class support for Maps and Sets! S... push 30 Oct 2019 08:44PM UTC GitHub travis-ci pending completion  
See All Builds (1015)
  • Repo on GitHub
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc