7 lines
154 B
TypeScript
Raw Normal View History

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