Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c4bc42f

Browse files
committed
chore: simplify implementation of act
1 parent c0ff791 commit c4bc42f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

‎src/pure.js‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,9 @@ const cleanup = () => {
109109
Array.from(containerCache.keys()).forEach(cleanupAtContainer)
110110
}
111111

112-
const act = (fn) => {
113-
const value = fn && fn()
114-
if (value !== undefined && typeof value.then === 'function') {
115-
return value.then(() => tick())
112+
const act = async (fn) => {
113+
if (fn) {
114+
await fn()
116115
}
117116
return tick()
118117
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /