Add throttling of usercount frames
This commit is contained in:
parent
e4decbc34f
commit
056b2a48ea
4 changed files with 20 additions and 3 deletions
9
src/util/throttle.js
Normal file
9
src/util/throttle.js
Normal 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
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue