Files
agentic-dev/turbo/generators/templates/event/consume/handler.ts.hbs

15 lines
717 B
Handlebars

// 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.
};