From 14541834e59aeac15532d14b445c7f5ca6a5f854 Mon Sep 17 00:00:00 2001 From: Trung Dang Date: Fri, 14 Feb 2025 15:55:42 +0700 Subject: [PATCH] types(function/invoke): ability to return the result's type --- src/function.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/function.ts b/src/function.ts index 448d9c2..696a590 100644 --- a/src/function.ts +++ b/src/function.ts @@ -8,9 +8,9 @@ export function batchInvoke(functions: Nullable[]) { } /** - * Call the function + * Call the function, returning the result */ -export function invoke(fn: Fn) { +export function invoke(fn: () => T): T { return fn() }