Skip to content

Commit 7f410a9

Browse files
authored
types(function/invoke): ability to return the result's type (#48)
1 parent 3f69588 commit 7f410a9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/function.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ export function batchInvoke(functions: Nullable<Fn>[]) {
88
}
99

1010
/**
11-
* Call the function
11+
* Call the function, returning the result
1212
*/
13-
export function invoke(fn: Fn) {
13+
export function invoke<T>(fn: () => T): T {
1414
return fn()
1515
}
1616

0 commit comments

Comments
 (0)