MCPcopy
hub / github.com/stackblitz/bolt.new / dispatch

Method dispatch

app/lib/hooks/useShortcuts.ts:8–10  ·  view source on GitHub ↗
(type: keyof Shortcuts)

Source from the content-addressed store, hash-verified

6 #emitter = new EventTarget();
7
8 dispatch(type: keyof Shortcuts) {
9 this.#emitter.dispatchEvent(new Event(type));
10 }
11
12 on(type: keyof Shortcuts, cb: VoidFunction) {
13 this.#emitter.addEventListener(type, cb);

Callers 5

newEditorStateFunction · 0.80
setNoDocumentFunction · 0.80
setEditorDocumentFunction · 0.80
handleKeyDownFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected