2019-11-18 11:04:13 +09:00

8 lines
177 B
TypeScript

export default function requestIdleCallback(func: Function) {
if("requestIdleCallback" in window) {
(window["requestIdleCallback"] as Function)(func)
} else {
func()
}
}