8 lines
214 B
TypeScript
Raw Normal View History

2018-04-02 05:34:16 +00:00
export function requestIdleCallback(func: Function) {
if("requestIdleCallback" in window) {
let requestIdleCallback = window["requestIdleCallback"] as Function
requestIdleCallback(func)
2018-04-02 05:34:16 +00:00
} else {
func()
}
}