Merge pull request #657 from prymitive/debounce-update

fix(ui): debounce grid updates so that they are batched
This commit is contained in:
Łukasz Mierzwa
2019-04-25 22:41:28 +01:00
committed by GitHub

View File

@@ -80,11 +80,14 @@ const AlertGrid = observer(
});
// used to call forcePack() which will repack all grid elements
// (alert groups), this needs to be called if any group size changes
masonryRepack = action(() => {
if (this.masonryComponentReference.ref) {
this.masonryComponentReference.ref.forcePack();
}
});
masonryRepack = debounce(
action(() => {
if (this.masonryComponentReference.ref) {
this.masonryComponentReference.ref.forcePack();
}
}),
50
);
// how many alert groups to render
// FIXME reset on filter change