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

Function makeHandler

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

Source from the content-addressed store, hash-verified

320 }
321}
322function makeHandler(encoding, commandList, stub, feature) {
323 return function(evt) {
324 var data = decode(evt.data, encoding);
325 var context = feature.runtime.makeContext(stub, feature, stub);
326 context.event = evt;
327 context.result = data;
328 commandList.execute(context);
329 };
330}
331function decode(data, encoding) {
332 if (encoding.toLowerCase() === "json") {
333 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