MCPcopy Create free account
hub / github.com/TanStack/ai / attachEventToHook

Function attachEventToHook

packages/ai-devtools/src/store/hook-registry.ts:788–797  ·  view source on GitHub ↗
(
  state: HookRegistryState,
  hookId: string | undefined,
  eventId: string,
)

Source from the content-addressed store, hash-verified

786}
787
788function attachEventToHook(
789 state: HookRegistryState,
790 hookId: string | undefined,
791 eventId: string,
792): void {
793 if (!hookId) return
794 const hook = state.hooks[hookId]
795 if (!hook || hook.eventIds.includes(eventId)) return
796 hook.eventIds.push(eventId)
797}
798
799function inferLifecycleFromSnapshot(
800 state: Record<string, unknown>,

Callers 1

applyHookEventFunction · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected