Skip to content

onPatches offPatches

Compare
Choose a tag to compare
@justinbmeyer justinbmeyer released this 12 Dec 02:02
· 26 commits to master since this release

Documents the onPatches and offPatches symbols and what patch objects look like:

add patches signal that a key was added to an object.

{type: "add", key: "b", value: 1}

delete patches signal that a key was deleted from an object.

{type: "delete", key: "a"}

set patches signal that an existing key's value was set to another value.

{type: "set", key: "c", value: 2}

splice patches signal a list-like object had enumerable values added, removed
or both at a specific index.

{type: "splice", index: 0, deleteCount: 10, insert: [item1, item2]}

move patches signal a list-like object had an enumerable value move from one
position to another.

{type: "move",   fromIndex: 1, toIndex: 2}

values patches signal a container-like object (like Set) has
had items added or removed.

{type: "values", delete: [item0], insert: [item1, item2]}