Skip to content

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

+3-4
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)