mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 21:48:20 +02:00
cleaning up
This commit is contained in:
@@ -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});
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user