Skip to content

Make target object per instance

Pre-release
Pre-release

Choose a tag to compare

@alshakero alshakero released this 16 Oct 10:53
· 12 commits to master since this release

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.