React lets you use whatever style of data management you want, including mutation. However, if you can use immutable data in performance-critical parts of your application it's easy to implement a fast shouldComponentUpdate() method to significantly speed up your app. Dealing with immutable data in JavaScript is more difficult than in languages designed for it, like Clojure. However, we've provided a simple immutability helper, update(), that makes dealing with this type of data much easier, without fundamentally changing how your data is represented. You can also take a look at Facebook's Immutable.js and React’s Using Immutable Data Structures section for more detail on Immutable.js. You have no way of determining which data has changed since the previous copy has been overwritten. Instead, you need to create a new copy of myData and change only the parts of it that need to be changed.

Features

  • It's statically analyzable and it's not much more typing than the mutative version
  • Toggle a list of boolean fields from the target object
  • Instead of a command object, you can pass a function
  • Update a value based on its current one
  • Arrays can be indexed into with runtime variables via the ES2015 Computed Property Names feature
  • Autovivification, for the auto creation of new arrays and objects when needed

Project Samples

Project Activity

See All Activity >

License

MIT License

Follow immutability-helper

immutability-helper Web Site

Other Useful Business Software
Get full visibility and control over your tasks and projects with Wrike. Icon
Get full visibility and control over your tasks and projects with Wrike.

A cloud-based collaboration, work management, and project management software

Wrike offers world-class features that empower cross-functional, distributed, or growing teams take their projects from the initial request stage all the way to tracking work progress and reporting results.
Learn More
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of immutability-helper!

Additional Project Details

Programming Language

TypeScript

Related Categories

TypeScript Version Control Software, TypeScript Data Management System

Registered

2021-12-06