Skip to content

Commit

Permalink
refactor(index.mjs): fix timeoutFn fallbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
addyosmani committed Dec 4, 2018
1 parent 61012b4 commit bfa8917
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ export default function (options) {
options = options || {
priority: 'low',
timeout: 2000,
timeoutFn: requestIdleCallback,
};
options.timeoutFn(() => {
const timeoutFn = options.timeoutFn || requestIdleCallback;
timeoutFn(() => {
// Prefetch an array of URLs if supplied (as an override)
if (options.urls !== undefined && options.urls.length > 0) {
prefetchURLs(options.urls, options.priority);
Expand Down

0 comments on commit bfa8917

Please # to comment.