Skip to content

Commit

Permalink
Timeline: Freeze object for performance.
Browse files Browse the repository at this point in the history
Avoids triggering the reactive tracker a million times.
  • Loading branch information
ishitatsuyuki committed May 30, 2022
1 parent 0cf0cec commit afd241f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/views/Timeline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,12 @@ export default {
methods: {
getBuckets: async function () {
if (this.daterange == null) return;
this.buckets = await useBucketsStore().getBucketsWithEvents({
start: this.daterange[0].format(),
end: this.daterange[1].format(),
});
this.buckets = Object.freeze(
await useBucketsStore().getBucketsWithEvents({
start: this.daterange[0].format(),
end: this.daterange[1].format(),
})
);
},
},
};
Expand Down

0 comments on commit afd241f

Please sign in to comment.