Files
johndoe6345789 7f495c97a9 Introduce AutoMetabuilder core components and workflow packages:
- Implement core components: CLI argument parsing, environment loading, GitHub service creation, and logging configuration.
- Add support for OpenAI client setup and model resolution.
- Develop SDLC context loader from GitHub and repository files.
- Implement workflow context and engine builders.
- Introduce major workflow packages: `game_tick_loop` and `contextual_iterative_loop`.
- Update localization files with new package descriptions and labels.
- Streamline web navigation by loading items from a dedicated JSON file.
2026-01-10 01:13:47 +00:00

23 lines
628 B
TypeScript

import { useEffect } from "react";
const emitter = new EventTarget();
export function emitWebhook(event: string, detail?: unknown) {
emitter.dispatchEvent(new CustomEvent(event, { detail }));
}
export default function useWebhook(
name: string,
handler: (detail: unknown) => void,
deps: unknown[] = []
) {
useEffect(() => {
const listener = (evt: Event) => {
handler((evt as CustomEvent).detail);
};
emitter.addEventListener(name, listener);
return () => emitter.removeEventListener(name, listener);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [name, handler, ...deps]);
}