cleaning up

This commit is contained in:
Kushan Joshi
2017-08-24 16:53:40 +05:30
parent 91a569985d
commit 909b72a39e
6 changed files with 26 additions and 107 deletions
+2 -4
View File
@@ -1,13 +1,11 @@
// note the function should be of low priority
// and should not be returning a value.
export function utilCallWhenIdle(func, timeout, name) {
export function utilCallWhenIdle(func, timeout) {
return function() {
var args = arguments;
var that = this;
console.log('called ', name);
window.requestIdleCallback(function() {
console.log('idle succeed ', name);
func.apply(that, args);
}, {timeout: timeout});
};
}
}
+1 -1
View File
@@ -23,4 +23,4 @@ export { utilTagText } from './util';
export { utilTriggerEvent } from './trigger_event';
export { utilWrap } from './util';
export { utilIdleWorker} from './idle_worker';
export { utilCallWhenIdle } from './call_when_idle';
export { utilCallWhenIdle } from './call_when_idle';