MCPcopy Create free account
hub / github.com/bigskysoftware/_hyperscript / dispatch

Function dispatch

src/ext/eventsource.js:331–342  ·  view source on GitHub ↗
(stub, eventType, evt)

Source from the content-addressed store, hash-verified

329// ========================================
330
331function dispatch(stub, eventType, evt) {
332 for (var i = 0; i < stub.listeners.length; i++) {
333 var listener = stub.listeners[i];
334 if (matchesEventPattern(listener.type, eventType)) {
335 try {
336 listener.handler(evt);
337 } catch (e) {
338 console.error("Error in SSE handler for '" + listener.type + "':", e);
339 }
340 }
341 }
342}
343
344// ========================================
345// HANDLER FACTORY

Callers 3

createStubFunction · 0.70
startConnectionFunction · 0.70
readStreamFunction · 0.70

Calls 2

matchesEventPatternFunction · 0.70
handlerMethod · 0.45

Tested by

no test coverage detected