7 lines
168 B
TypeScript
7 lines
168 B
TypeScript
export function requestIdleCallback(func: Function) {
|
|
if("requestIdleCallback" in window) {
|
|
(window["requestIdleCallback"] as Function)(func)
|
|
} else {
|
|
func()
|
|
}
|
|
} |