MCPcopy Index your code
hub / github.com/resend/react-email / dispatch

Method dispatch

packages/editor/src/core/event-bus.ts:44–57  ·  view source on GitHub ↗
(
    eventName: T,
    payload: EditorEventMap[T],
    options?: { target?: EventTarget },
  )

Source from the content-addressed store, hash-verified

42 }
43
44 dispatch<T extends EditorEventName>(
45 eventName: T,
46 payload: EditorEventMap[T],
47 options?: { target?: EventTarget },
48 ): void {
49 const target = options?.target ?? window;
50 const prefixedEventName = this.prefixEventName(eventName);
51 const event = new CustomEvent(prefixedEventName, {
52 detail: payload,
53 bubbles: false,
54 cancelable: false,
55 });
56 target.dispatchEvent(event);
57 }
58
59 on<T extends EditorEventName>(
60 eventName: T,

Callers 15

setTextAlignmentFunction · 0.80
event-bus.spec.tsFile · 0.80
createPasteHandlerFunction · 0.80
updateParentBlockStyleFunction · 0.80
updateParentBlockPaddingFunction · 0.80
customUpdateAttributesFunction · 0.80
customUpdateStylesFunction · 0.80
swapImageSrcFunction · 0.80
removeImageBySrcFunction · 0.80
onLanguageLoadedFunction · 0.80
addProseMirrorPluginsFunction · 0.80

Calls 1

prefixEventNameMethod · 0.95

Tested by 7

createEditorFunction · 0.64
createEditorWithContentFunction · 0.64
onCreateFunction · 0.64
createEmptyEditorFunction · 0.64
createEditorFunction · 0.64
selectSectionNodeFunction · 0.64
selectFirstParagraphTextFunction · 0.64