Skip to content

Commit 146f11c

Browse files
committed
Use Promise.resolve factory function
1 parent 480d566 commit 146f11c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

examples/index.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222
} else if (urlObj.pathname === '/marquee') {
2323
html = `<marquee>${urlObj.searchParams.get('q') || '🐈 Nothing to preview 🐈'}</marquee>`
2424
}
25-
const promiseHTML = new Promise(resolve => resolve(html))
26-
return new Promise(resolve => resolve({ok: true, text: () => promiseHTML}))
25+
return Promise.resolve({ok: true, text: () => Promise.resolve(html)})
2726
}
2827
window.fetch = fakeFetch
2928
</script>

0 commit comments

Comments
 (0)