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

Function eventsourcePlugin

www/js/ext/eventsource.esm.js:398–406  ·  view source on GitHub ↗
(_hyperscript)

Source from the content-addressed store, hash-verified

396};
397streamConversion._rawResponse = true;
398function eventsourcePlugin(_hyperscript) {
399 _hyperscript.addFeature(EventSourceFeature.keyword, EventSourceFeature.parse.bind(EventSourceFeature));
400 _hyperscript.config.conversions.Stream = streamConversion;
401 addEventListener("hyperscript:beforeFetch", function(evt) {
402 if (evt.detail.conversion === "Stream") {
403 evt.detail.headers["Accept"] = "text/event-stream";
404 }
405 });
406}
407if (typeof self !== "undefined" && self._hyperscript) {
408 self._hyperscript.use(eventsourcePlugin);
409}

Callers

nothing calls this directly

Calls 1

addFeatureMethod · 0.45

Tested by

no test coverage detected