Skip to content

Commit 1aa87fb

Browse files
authored
Merge pull request #9 from 1000hz/fix-blocking-pending-scripts
fix: append pending inline text only after unblocked
2 parents 020d50b + dd14cd5 commit 1aa87fb

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/index.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,13 @@ export = function writableDOM(
7474
}
7575
},
7676
close() {
77-
appendInlineTextIfNeeded(pendingText, inlineHostNode);
78-
79-
return isBlocked
77+
const promise = isBlocked
8078
? new Promise<void>((_) => (resolve = _))
8179
: Promise.resolve();
80+
81+
return promise.then(() => {
82+
appendInlineTextIfNeeded(pendingText, inlineHostNode);
83+
});
8284
},
8385
};
8486

0 commit comments

Comments
 (0)