Skip to content

Commit bfa8917

Browse files
committed
refactor(index.mjs): fix timeoutFn fallbacks
1 parent 61012b4 commit bfa8917

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/index.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ export default function (options) {
7575
options = options || {
7676
priority: 'low',
7777
timeout: 2000,
78-
timeoutFn: requestIdleCallback,
7978
};
80-
options.timeoutFn(() => {
79+
const timeoutFn = options.timeoutFn || requestIdleCallback;
80+
timeoutFn(() => {
8181
// Prefetch an array of URLs if supplied (as an override)
8282
if (options.urls !== undefined && options.urls.length > 0) {
8383
prefetchURLs(options.urls, options.priority);

0 commit comments

Comments
 (0)