7 lines
168 B
TypeScript
Raw Normal View History

2018-04-02 05:34:16 +00:00
export function requestIdleCallback(func: Function) {
if("requestIdleCallback" in window) {
2018-10-11 03:09:12 +00:00
(window["requestIdleCallback"] as Function)(func)
2018-04-02 05:34:16 +00:00
} else {
func()
}
}