Skip to content

Instantly share code, notes, and snippets.

@daybrush
Created July 8, 2019 08:19
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/710e4594cd64bd317426eec8002646b1 to your computer and use it in GitHub Desktop.
Save daybrush/710e4594cd64bd317426eec8002646b1 to your computer and use it in GitHub Desktop.
ordered, pureChanged
import ListDiffer from "@egjs/list-differ";
const listDiffer = new ListDiffer([1, 2, 3, 4, 5, 6, 7], v => v);
const result = listDiffer.update([4, 3, 8, 2, 1, 7]);
// [[3, 0], [3, 1], [3, 2]]
console.log(result.ordered);
// [[3, 0], [2, 1], [1, 3]]
console.log(result.pureChanged);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment