2016-08-10 21:36:11 +02:00
|
|
|
/**
|
|
|
|
* Collection of helper function to act on Immutable objects.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Diff two immutables objects supporting the filter method.
|
|
|
|
*
|
|
|
|
* @param a First Immutable object.
|
|
|
|
* @param b Second Immutable object.
|
|
|
|
* @returns An Immutable object equal to a except for the items in b.
|
|
|
|
*/
|
2016-08-10 23:50:23 +02:00
|
|
|
export function immutableDiff(a, b) {
|
2016-08-01 00:26:52 +02:00
|
|
|
return a.filter(function (i) {
|
|
|
|
return b.indexOf(i) < 0;
|
|
|
|
});
|
|
|
|
}
|