mapeo-id-bmf
Version:
iD Editor for osm-p2p & mapeo-desktop changed to meet requirements of Bruno Manser Fonds
12 lines (11 loc) • 352 B
JavaScript
// note the function should be of low priority
// and should not be returning a value.
export function utilCallWhenIdle(func, timeout) {
return function() {
var args = arguments;
var that = this;
window.requestIdleCallback(function() {
func.apply(that, args);
}, {timeout: timeout});
};
}