feat(turbo-gen): templates for gen event consume (handler + Payload task)

This commit is contained in:
2026-05-08 16:16:35 +02:00
parent 5cc6099015
commit d53869f712
3 changed files with 52 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
// packages/{{kebabCase feature}}/src/events/handlers/on-{{kebabCase publisher}}-{{kebabCase event}}.handler.ts
import type { {{pascalCase event}}Event } from "@repo/{{kebabCase publisher}}";
export type IOn{{pascalCase publisher}}{{pascalCase event}}Handler = ReturnType<
typeof on{{pascalCase publisher}}{{pascalCase event}}Handler
>;
export const on{{pascalCase publisher}}{{pascalCase event}}Handler =
() =>
async (_event: {{pascalCase event}}Event): Promise<void> => {
// TODO: implement the reaction. Inject dependencies via the factory's
// constructor and use them here. The handler runs inside the consumer's
// span+capture sandwich, so just throwing on failure is the right shape.
};