Skip to content

Commit fb36f7f

Browse files
wip(docs): simplify example readability
1 parent 66e8b54 commit fb36f7f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,12 @@ Load .vue files dynamically at runtime from your html/js. No node.js environment
3030
vue: Vue
3131
},
3232
33-
getFile(url) {
33+
async getFile(url) {
3434
35-
return fetch(url).then(res => res.ok ? res.text() : Promise.reject( Object.assign(new Error(url+' '+res.statusText), { res }) ));
35+
const res = await fetch(url);
36+
if ( !res.ok )
37+
throw Object.assign(new Error(url+' '+res.statusText), { res });
38+
return await res.text();
3639
},
3740
3841
addStyle(textContent) {

0 commit comments

Comments
 (0)