MCPcopy
hub / github.com/vexip-ui/vexip-ui / emitEvent

Function emitEvent

common/config/src/props.ts:374–387  ·  view source on GitHub ↗
(
  handlers: MaybeArray<(...args: A) => void> | undefined,
  ...args: A
)

Source from the content-addressed store, hash-verified

372}
373
374export function emitEvent<A extends any[]>(
375 handlers: MaybeArray<(...args: A) => void> | undefined,
376 ...args: A
377) {
378 if (Array.isArray(handlers)) {
379 for (let i = 0, len = handlers.length; i < len; ++i) {
380 const handler = handlers[i]
381
382 typeof handler === 'function' && handler(...args)
383 }
384 } else {
385 typeof handlers === 'function' && handlers(...args)
386 }
387}
388
389export function localeProp<N extends LocaleNames>(_name: N) {
390 return Object as PropType<Partial<LocaleConfig[N]>>

Callers 15

toggleExpandedFunction · 0.90
toggleReducedFunction · 0.90
handleSignClickFunction · 0.90
handleMenuSelectFunction · 0.90
handleUserActionSelectFunction · 0.90
handleSignTypeChangeFunction · 0.90
toggleExpandedFunction · 0.90
toggleReducedFunction · 0.90
handleColorChangeFunction · 0.90
handleSignClickFunction · 0.90
toggleUserDroppedFunction · 0.90
handleMenuSelectFunction · 0.90

Calls 1

handlerFunction · 0.50

Tested by

no test coverage detected