list-difference
Calculates difference between two arrays.
/** * Calculates difference between two arrays. * Returns array of { item: T, state: int }. * Where state means: 0 - not modified, 1 - created, -1 - deleted. * @param * @param * @param */;
How to use
var a = x: 1 ;var b = x: 2 ;var c = x: 3 ; // createdshould; // deletedshould; // not modifiedshould; // replacedshould; // movedshould;
Available states
State | Value |
---|---|
diff.NOT_MODIFIED | 0 |
diff.CREATED | 1 |
diff.MOVED | 2 |
diff.DELETED | -1 |