Releases: Palindrom/JSON-Patch-Queue
Releases · Palindrom/JSON-Patch-Queue
ES6 Module
- source files now export ES6 modules Palindrom/JSON-Patch-OT#9,
- updated test libraries #8
Make target object per instance
Even though JSON-Patch-Queue always needed to be instantiated by its constructor, it used to act a bit like a collection of static methods, that's why it needed the target object obj
to be passed to every receive
and reset
call (eg: receive(obj, patch)
).
From 3.x, JSON-Patch-Queue is more like a class that you need to instantiate with all your details including the target object. And then operate with those passed details. This means you no longer need to pass the target object with every API call, calling receive(patch)
and reset(newState)
is sufficient.
CommonJS, ES6, and TS includes support
Now you can install JSON-Patch-Queue
from NPM as in:
npm install json-patch-queue
Usage examples:
<script src='dist/json-patch-queue-synchronous.min.js'></script>
or
<script src='dist/json-patch-queue.min.js'></script>
in Node's CommonJS
var JSONPatchQueue = require('json-patch-queue').JSONPatchQueue;
Or
var JSONPatchQueue = require('json-patch-queue').JSONPatchQueueSynchronous;
in Node's TS and ES6
import { JSONPatchQueue } from 'json-patch-queue';
or
import { JSONPatchQueueSynchronous } from 'json-patch-queue';