Clone buffer before push

This commit is contained in:
Jerry Kurian 2019-11-01 10:09:13 -04:00
parent 1794910b64
commit 298a8b328d

View File

@ -59,7 +59,7 @@ function _sliding<T>(
buffer.shift();
}
buffer.push(event);
stream.push(buffer);
stream.push([...buffer]);
};
}
@ -73,7 +73,7 @@ function _slidingByFunction<T>(
}
buffer.splice(0, index);
buffer.push(event);
stream.push(buffer);
stream.push([...buffer]);
};
}