Skip to content

Commit

Permalink
Merge pull request #973 from thefrontside/fix-call-types
Browse files Browse the repository at this point in the history
πŸ› resolve operation overload before simple function overload
  • Loading branch information
taras authored Feb 14, 2025
2 parents 10e31d0 + 9650e74 commit a511636
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/call.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,12 @@ export function call<T, TArgs extends unknown[] = []>(
fn: (...args: TArgs) => Promise<T>,
): Operation<T>;
export function call<T, TArgs extends unknown[] = []>(
fn: (...args: TArgs) => T,
fn: (...args: TArgs) => Operation<T>,
): Operation<T>;
export function call<T, TArgs extends unknown[] = []>(
fn: (...args: TArgs) => Operation<T>,
fn: (...args: TArgs) => T,
): Operation<T>;

export function call<T, TArgs extends unknown[] = []>(
callable: Callable<T, TArgs>,
...args: TArgs
Expand Down

0 comments on commit a511636

Please sign in to comment.