Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b6212f7

Browse files
committed
refactor: flatten Promise.resolve()
1 parent ecce92e commit b6212f7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,7 @@ export default class IncludeFragmentElement extends HTMLElement {
147147

148148
load(): Promise<string> {
149149
observer.unobserve(this)
150-
return Promise.resolve()
151-
.then(task)
150+
return task()
152151
.then(() => {
153152
this.dispatchEvent(new Event('loadstart'))
154153
return this.fetch(this.request())

0 commit comments

Comments
 (0)