Skip to content

Commit

Permalink
Return Shallow Copies of Rows
Browse files Browse the repository at this point in the history
  • Loading branch information
jameskerr committed Feb 5, 2024
1 parent 270f84e commit d05e9d7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/zed-js/src/query/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ export class Channel extends EventEmitter {
let timeId: ReturnType<typeof setTimeout>;

const flush = () => {
collector({ rows: this.rows, shapesMap: this.shapesMap });
// Return shallow copies so that comsumers can do what they want
// with the rows and shapes
collector({ rows: [...this.rows], shapesMap: { ...this.shapesMap } });
first = false;
count = 0;
clearTimeout(timeId);
Expand Down

0 comments on commit d05e9d7

Please sign in to comment.