Skip to content

Commit

Permalink
fix: Add missing timeout param (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
haxzie committed Dec 1, 2020
1 parent 396a7fe commit ccd762f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function installRouterPrefetch(

const requestIdleCallback =
(inBrowser && window.requestIdleCallback) ||
function(cb) {
function(cb, { timeout = 1 }) {
const start = Date.now()
return setTimeout(() => {
cb({
Expand All @@ -26,7 +26,7 @@ function installRouterPrefetch(
return Math.max(0, 50 - (Date.now() - start))
}
})
}, 1)
}, timeout)
}

const RouterLink = Vue.component('RouterLink') || Vue.component('router-link')
Expand Down

0 comments on commit ccd762f

Please sign in to comment.