Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed Feb 21, 2025
1 parent a3aa4f3 commit 0b18d81
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/svelte/src/internal/client/runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ function process_effects(effect) {
* Returns void if no callback is provided, otherwise returns the result of calling the callback.
* @template [T=void]
* @param {(() => T) | undefined} [fn]
* @returns {T extends void ? void : T}
* @returns {T}
*/
export function flushSync(fn) {
var result;
Expand All @@ -839,7 +839,7 @@ export function flushSync(fn) {
flush_tasks();
}

return /** @type {T extends void ? void : T} */ (result);
return /** @type {T} */ (result);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/svelte/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ declare module 'svelte' {
* Synchronously flush any pending updates.
* Returns void if no callback is provided, otherwise returns the result of calling the callback.
* */
export function flushSync<T = void>(fn?: (() => T) | undefined): T extends void ? void : T;
export function flushSync<T = void>(fn?: (() => T) | undefined): T;
/**
* Returns a promise that resolves once any pending state changes have been applied.
* */
Expand Down

0 comments on commit 0b18d81

Please sign in to comment.