We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 43306cf commit 18bea81Copy full SHA for 18bea81
1 file changed
src/index.mjs
@@ -70,7 +70,7 @@ const prefetchURLs = function (urls, priority) {
70
*/
71
export default function (options) {
72
return new Promise((resolve, reject) => {
73
- options = options || {priority: 'low'};
+ options = options || {priority: 'low', timeout: 2000};
74
requestIdleCallback(() => {
75
// Prefetch an array of URLs if supplied (as an override)
76
if (options.urls !== undefined && options.urls.length > 0) {
@@ -84,6 +84,6 @@ export default function (options) {
84
resolve(urls);
85
});
86
}
87
- });
+ }, {timeout: options.timeout});
88
89
0 commit comments