MCPcopy Create free account
hub / github.com/Linen-dev/linen.dev / emit

Function emit

packages/utilities/src/event.js:2–8  ·  view source on GitHub ↗
(name, data)

Source from the content-addressed store, hash-verified

1const EventEmitter = {
2 emit(name, data) {
3 this.setup();
4 if (!window.LINEN_EVENT_HANDLERS[name]) {
5 return;
6 }
7 window.LINEN_EVENT_HANDLERS[name].forEach((callback) => callback(data));
8 },
9 on(name, callback) {
10 this.setup();
11 if (!window.LINEN_EVENT_HANDLERS[name]) {

Callers

nothing calls this directly

Calls 1

callbackFunction · 0.50

Tested by

no test coverage detected