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