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

mweststrate / immer / 1038
99%

Build:
DEFAULT BRANCH: master
Ran 30 Oct 2019 08:35PM UTC
Jobs 1
Files 7
Run time 2s
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

pending completion
1038

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

Jobs
ID Job ID Ran Files Coverage
2 1038.2 (NODE_ENV=TEST) 30 Oct 2019 08:35PM UTC 0
97.9
Travis Job 1038.2
Source Files on build 1038
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #1038
  • b6f1d409 on github
  • Prev Build on master (#1013)
  • Next Build on master (#1048)
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

© 2026 Coveralls, Inc