Clone buffer before push
This commit is contained in:
parent
1794910b64
commit
298a8b328d
@ -59,7 +59,7 @@ function _sliding<T>(
|
|||||||
buffer.shift();
|
buffer.shift();
|
||||||
}
|
}
|
||||||
buffer.push(event);
|
buffer.push(event);
|
||||||
stream.push(buffer);
|
stream.push([...buffer]);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,7 +73,7 @@ function _slidingByFunction<T>(
|
|||||||
}
|
}
|
||||||
buffer.splice(0, index);
|
buffer.splice(0, index);
|
||||||
buffer.push(event);
|
buffer.push(event);
|
||||||
stream.push(buffer);
|
stream.push([...buffer]);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user