mirror of
https://github.com/Hopiu/postal.js.git
synced 2026-04-05 15:40:59 +00:00
15 lines
No EOL
292 B
JavaScript
15 lines
No EOL
292 B
JavaScript
var ConsecutiveDistinctPredicate = function () {
|
|
var previous;
|
|
return function ( data ) {
|
|
var eq = false;
|
|
if ( _.isString( data ) ) {
|
|
eq = data === previous;
|
|
previous = data;
|
|
}
|
|
else {
|
|
eq = _.isEqual( data, previous );
|
|
previous = _.clone( data );
|
|
}
|
|
return !eq;
|
|
};
|
|
}; |