🐛 fix git throttle decorator

fixes #25271
This commit is contained in:
Joao Moreno 2017-04-26 16:44:54 +02:00
parent aa69d4df8a
commit c973c34597

View file

@ -67,9 +67,8 @@ function _throttle<T>(fn: Function, key: string): Function {
this[currentKey] = fn.apply(this, args) as Promise<T>;
done(this[currentKey]).then(() => {
this[currentKey] = undefined;
});
const clear = () => this[currentKey] = undefined;
done(this[currentKey]).then(clear, clear);
return this[currentKey];
};