Skip to content

fix(types): correct type annotation for act #288

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ export type FireObject = {
export const fireEvent: FireFunction & FireObject;

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