Skip to content

Instantly share code, notes, and snippets.

@daybrush
Last active July 8, 2019 07:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daybrush/ca59547608d4e57ee84c719791ff0f36 to your computer and use it in GitHub Desktop.
Save daybrush/ca59547608d4e57ee84c719791ff0f36 to your computer and use it in GitHub Desktop.
ListDiffer, ChildrenDiffer
import ListDiffer from "@egjs/list-differ";
import ChildrenDiffer from "@egjs/children-differ";
// Indicates the callback function that finds the key for that data.
// And only numbers or strings are allowed.
const listDiffer = new ListDiffer([], v => v);
const childrenDiffer = new childrenDiffer(document.body.children);
document.body.appendChild(document.createElement("div"));
const result = childrenDiffer.update(document.body.children);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment