immutablediff
Create RFC 6902 style patches between Immutable.JS data structures
Last updated 9 years ago by intelie .
MIT · Repository · Bugs · Original npm
$ cnpm install immutablediff 
SYNC missed versions from official npm registry.

#Immutable Diff

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

##Getting Started

Install immutablediff using npm.

npm install 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

Current Tags

  • 0.4.4                                ...           latest (9 years ago)

1 Versions

  • 0.4.4                                ...           9 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (5)
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org