Optimize append and remove options

This commit is contained in:
Sergio Crisostomo 2017-09-03 08:49:45 +02:00
parent 17db7df4fd
commit 9c32a05699
3 changed files with 30 additions and 29 deletions

View file

@ -0,0 +1,14 @@
export function debounce(fn) {
let waiting;
return function() {
if (waiting) return;
waiting = true;
const context = this,
args = arguments;
const later = function() {
waiting = false;
fn.apply(context, args);
};
this.$nextTick(later);
};
}