declare var window ; const requestIdleCallback = window . requestIdleCallback || ( ( fn ) => fn ( ) ) ; export default requestIdleCallback ; export function scheduleForIdle < T > ( fn ) { return ( ... args ) => { requestIdleCallback ( ( ) => fn ( ... args ) ) ; } ; } ;