David Michael Gang
David Michael Gang

Reputation: 7299

Impact of using immutable.js with angularjs

There is a very powerful library called immutablejs

The philosophy comes from functional programming that a data structure is immutable and that every operation on a data structure creates a new one. This makes the program more modular, easy to prove and easier to multiprocess the data.

Currently it is used in reactjs. I like the concept from using the scala language. Would it be a good idea to use it with angularjs or would it make a mess with the watcher of the objects, as they would think that all objects were created from scratch and change the whole dom connected to this model on a certain digest?

Upvotes: 4

Views: 2546

Answers (2)

David Michael Gang
David Michael Gang

Reputation: 7299

Angular 2 will be able to use immutable objects in order to speed up change detection.

Take a look at: http://victorsavkin.com/post/110170125256/change-detection-in-angular-2

Upvotes: 1

satish
satish

Reputation: 2441

There is a angular-immutable module availble for the use which has a directive to optimize the digest cycle of the angular when used with immutableJS. You can learn more about it from the author's blog post

Upvotes: 2

Related Questions