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

Function makeHandler

www/js/ext/eventsource.js:323–331  ·  view source on GitHub ↗
(encoding, commandList, stub, feature)

Source from the content-addressed store, hash-verified

321 }
322 }
323 function makeHandler(encoding, commandList, stub, feature) {
324 return function(evt) {
325 var data = decode(evt.data, encoding);
326 var context = feature.runtime.makeContext(stub, feature, stub);
327 context.event = evt;
328 context.result = data;
329 commandList.execute(context);
330 };
331 }
332 function decode(data, encoding) {
333 if (encoding.toLowerCase() === "json") {
334 return JSON.parse(data);

Callers 1

parseMethod · 0.70

Calls 3

decodeFunction · 0.70
makeContextMethod · 0.45
executeMethod · 0.45

Tested by

no test coverage detected