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

Function eventsourcePlugin

src/ext/eventsource.js:441–450  ·  view source on GitHub ↗
(_hyperscript)

Source from the content-addressed store, hash-verified

439// ========================================
440
441export default function eventsourcePlugin(_hyperscript) {
442 _hyperscript.addFeature(EventSourceFeature.keyword, EventSourceFeature.parse.bind(EventSourceFeature));
443 _hyperscript.config.conversions.Stream = streamConversion;
444
445 addEventListener("hyperscript:beforeFetch", function(evt) {
446 if (evt.detail.conversion === "Stream") {
447 evt.detail.headers["Accept"] = "text/event-stream";
448 }
449 });
450}
451
452if (typeof self !== 'undefined' && self._hyperscript) {
453 self._hyperscript.use(eventsourcePlugin);

Callers

nothing calls this directly

Calls 1

addFeatureMethod · 0.45

Tested by

no test coverage detected