Skip to content

Commit 9ef86c7

Browse files
authored
Merge pull request #288 from mcous/fix-134
fix(types): correct type annotation for `act`
2 parents c0ff791 + 38f7518 commit 9ef86c7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

types/index.d.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ export type FireObject = {
6060
export const fireEvent: FireFunction & FireObject;
6161

6262
/**
63-
* Calls a function or resolves a Promise and notifies Svelte to immediately flushes any pending
64-
* state changes.
63+
* Calls a function and notifies Svelte to flush any pending state changes.
64+
*
65+
* If the function returns a Promise, that Promise will be resolved first.
6566
*/
66-
export function act(fn?: Function | Promise<any>): Promise<void>
67+
export function act(fn?: () => unknown): Promise<void>

0 commit comments

Comments
 (0)