@anyjunk/immutablepatch
npm i @anyjunk/immutablepatch

@anyjunk/immutablepatch

Apply RFC 6902 style patches to Immutable.JS data structures

by intelie

0.4.2 (see all)License:MITTypeScript:Not Found
npm i @anyjunk/immutablepatch
Readme

Immutable Patch

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

Getting Started

You may get the module via npm:

npm install immutablepatch

And apply JSON patches to an immutable JSON object:

var Immutable = require('immutable');
var patch = require('immutablepatch');

var list = Immutable.fromJS([1, 2, [3, 4]]);
var ops = Immutable.fromJS([
  {op: 'replace', path: '/2/1', value: 10}
]);

var result = patch(list, ops);
// var expected = Immutable.fromJS([1, 2, [3, 10]]);

You will probably need immutablediff to generate diff operations.

Downloads/wk

46

GitHub Stars

87

LAST COMMIT

4yrs ago

MAINTAINERS

1

CONTRIBUTORS

10

OPEN ISSUES

2

OPEN PRs

0
VersionTagPublished
0.4.2
latest
5yrs ago
No alternatives found
No tutorials found
Add a tutorial