|
|
|
|
63
|
|
63
|
|
64
|
return new Promise((resolve, reject) => {
|
64
|
return new Promise((resolve, reject) => {
|
65
|
const seconds = options.timeout !== undefined ? options.timeout : Infinity;
|
65
|
const seconds = options.timeout !== undefined ? options.timeout : Infinity;
|
66
|
- const timeoutFn = () => reject(new Error(`Can't preload assets: timeout!`));
|
|
|
|
|
66
|
+ const timeoutFn = () => reject(new Error(`Can't preload assets: slow connection!`));
|
67
|
const timeoutId = isFinite(seconds) ? setTimeout(timeoutFn, seconds * 1000) : undefined;
|
67
|
const timeoutId = isFinite(seconds) ? setTimeout(timeoutFn, seconds * 1000) : undefined;
|
68
|
|
68
|
|
69
|
fetch(url)
|
69
|
fetch(url)
|