Throttling session calls due to performance issues

This commit is contained in:
Bruno Alves de Faria 2016-08-20 11:24:27 -03:00
parent 8832f101ad
commit 3732d7cf70

View File

@ -15,16 +15,15 @@ LayoutManager = class LayoutManager {
this.viewportData = []; this.viewportData = [];
this.isZoomed = false; this.isZoomed = false;
const updateSessionFn = () => Tracker.afterFlush(() => Session.set('LayoutManagerUpdated', Random.id()));
this.updateSession = _.throttle(updateSessionFn, 300);
} }
getNumberOfViewports() { getNumberOfViewports() {
return this.layoutProps.rows * this.layoutProps.columns; return this.layoutProps.rows * this.layoutProps.columns;
} }
updateSession() {
Tracker.afterFlush(() => Session.set('LayoutManagerUpdated', Random.id()));
}
setDefaultViewportData() { setDefaultViewportData() {
var numViewports = this.getNumberOfViewports(); var numViewports = this.getNumberOfViewports();