We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent be441dc commit 84a0468Copy full SHA for 84a0468
1 file changed
src/prefetch.mjs
@@ -110,7 +110,7 @@ const supportedPrefetchStrategy = support(`prefetch`)
110
* @param {Boolean} isPriority - if is "high" priority
111
* @return {Object} a Promise
112
*/
113
-async function prefetcher(url, isPriority) {
+function prefetcher(url, isPriority) {
114
if (preFetched[url]) {
115
return;
116
}
@@ -126,12 +126,10 @@ async function prefetcher(url, isPriority) {
126
127
128
129
- try {
130
- await (isPriority ? highPriFetchStrategy : supportedPrefetchStrategy)(url);
+ // Wanna do something on catch()?
+ return (isPriority ? highPriFetchStrategy : supportedPrefetchStrategy)(url).then(() => {
131
preFetched[url] = true;
132
- } catch (e) {
133
- // Wanna do something?
134
- }
+ });
135
};
136
137
export default prefetcher;
0 commit comments