Skip to content

Commit ccd762f

Browse files
authored
fix: Add missing timeout param (#31)
1 parent 396a7fe commit ccd762f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function installRouterPrefetch(
1717

1818
const requestIdleCallback =
1919
(inBrowser && window.requestIdleCallback) ||
20-
function(cb) {
20+
function(cb, { timeout = 1 }) {
2121
const start = Date.now()
2222
return setTimeout(() => {
2323
cb({
@@ -26,7 +26,7 @@ function installRouterPrefetch(
2626
return Math.max(0, 50 - (Date.now() - start))
2727
}
2828
})
29-
}, 1)
29+
}, timeout)
3030
}
3131

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

0 commit comments

Comments
 (0)