(_hyperscript)
| 439 | // ======================================== |
| 440 | |
| 441 | export 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 | |
| 452 | if (typeof self !== 'undefined' && self._hyperscript) { |
| 453 | self._hyperscript.use(eventsourcePlugin); |
nothing calls this directly
no test coverage detected