Skip to content

Forked to add support for Records in ImmutableJS 4.x.x

License

Notifications You must be signed in to change notification settings

giuseppepaul/immutable-js-diff

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Immutable Diff

Forked to add support for Records in ImmutableJS 4.x.x

Create RFC 6902 style patches between Immutable.JS data structures, such as Maps, Lists, and Sets.

Getting Started

Install immutablediff using npm or yarn:

# npm...
npm install --save immutablediff

# ...or yarn
yarn add immutablediff

You can then use it to get the diff ops between you Immutable.JS data structures.

var Immutable = require('immutable');
var diff = require('immutablediff');

var map1 = Immutable.Map({a:1, b:2, c:3});
var map2 = Immutable.Map({a:1, b:2, c:3, d: 4});

diff(map1, map2);
// List [ Map { op: "add", path: "/d", value: 4 } ]

The result of diff is an Immutable Sequence of operations

Immutable Patch

If you want to use the resulting diff to apply patches to other Immutable data structures, you can use the package immutablepatch. Source code available here

About

Forked to add support for Records in ImmutableJS 4.x.x

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%