Add throttling of usercount frames

This commit is contained in:
calzoneman 2016-06-18 00:32:50 -07:00
parent e4decbc34f
commit 056b2a48ea
4 changed files with 20 additions and 3 deletions

9
src/util/throttle.js Normal file
View file

@ -0,0 +1,9 @@
import lo from 'lodash';
export function throttle(fn, timeout) {
return lo.debounce(fn, timeout, {
leading: true,
trailing: true,
maxWait: timeout
});
}