MCPcopy
hub / github.com/coder/mux / createCustomEvent

Function createCustomEvent

src/common/constants/events.ts:229–235  ·  view source on GitHub ↗
(
  eventName: K,
  ...args: CustomEventPayloads[K] extends never ? [] : [detail: CustomEventPayloads[K]]
)

Source from the content-addressed store, hash-verified

227 * ```
228 */
229export function createCustomEvent<K extends keyof CustomEventPayloads>(
230 eventName: K,
231 ...args: CustomEventPayloads[K] extends never ? [] : [detail: CustomEventPayloads[K]]
232): CustomEvent<CustomEventPayloads[K]> {
233 const [detail] = args;
234 return new CustomEvent(eventName, { detail } as CustomEventInit<CustomEventPayloads[K]>);
235}
236
237/**
238 * Helper to create a storage change event name for a specific key

Callers 15

CommandPaletteFunction · 0.90
WorkspaceMenuBarFunction · 0.90
processSlashCommandFunction · 0.90
handleGoalCommandFunction · 0.90
showCommandFeedbackToastFunction · 0.90
openGoalPanelFunction · 0.90
buildCoreSourcesFunction · 0.90
WorkspaceStoreClass · 0.90
StreamErrorMessageBaseFunction · 0.90
openGoalTabFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected