dependency hell fixes
This commit is contained in:
parent
50e5b5cbed
commit
24768446f5
20 changed files with 219 additions and 197 deletions
16
libs/core/handlers/src/utils/create-job-handler.ts
Normal file
16
libs/core/handlers/src/utils/create-job-handler.ts
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
/**
|
||||
* Utility for creating typed job handlers
|
||||
*/
|
||||
|
||||
import type { JobHandler, TypedJobHandler } from '@stock-bot/types';
|
||||
|
||||
/**
|
||||
* Create a typed job handler with validation
|
||||
*/
|
||||
export function createJobHandler<TPayload = unknown, TResult = unknown>(
|
||||
handler: TypedJobHandler<TPayload, TResult>
|
||||
): JobHandler<unknown, TResult> {
|
||||
return async (payload: unknown): Promise<TResult> => {
|
||||
return handler(payload as TPayload);
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue