var streamSSE = (c, cb, onError) => {
const { readable, writable } = new TransformStream();
const stream = new SSEStreamingApi(writable, readable);
c.header("Transfer-Encoding", "chunked");
c.header("Content-Type", "text/event-stream");
c.header("Cache-Control", "no-cache");
c.header("Connection", "keep-alive");
run(stream, cb, onError);
return c.newResponse(stream.responseReadable);
};
var streamSSE = (c, cb, onError) => {
const { readable, writable } = new TransformStream();
const stream = new SSEStreamingApi(writable, readable);
c.header("Transfer-Encoding", "chunked");
c.header("Content-Type", "text/event-stream");
c.header("Cache-Control", "no-cache");
c.header("Connection", "keep-alive");
run(stream, cb, onError);
return c.newResponse(stream.responseReadable);
};