From e85fc99c845447978e652b5085f71e59e8059484 Mon Sep 17 00:00:00 2001 From: Nikos Kostoulas Date: Thu, 7 Nov 2024 12:35:00 +0200 Subject: [PATCH] Add generic type in runWithContext --- src/builder.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/builder.ts b/src/builder.ts index ffc32c0c..fd4bdd95 100644 --- a/src/builder.ts +++ b/src/builder.ts @@ -12,7 +12,7 @@ let als: AsyncLocalStorage> = new AsyncLocalStorage als?.getStore(); -export const runWithContext = (store: Map, callback: (args: any[]) => void, ...args: any[]) => { +export const runWithContext = (store: Map, callback: (args: any[]) => T, ...args: any[]) => { if (!als) { throw new Error('AsyncLocalStorage is not supported'); }