Commit 78906d85 by archer

perf: sse

parent b142c04b
...@@ -83,6 +83,7 @@ export const sseResponse = ({ ...@@ -83,6 +83,7 @@ export const sseResponse = ({
event?: string; event?: string;
data: string; data: string;
}) => { }) => {
if (res.closed) return;
event && res.write(`event: ${event}\n`); event && res.write(`event: ${event}\n`);
res.write(`data: ${data}\n\n`); res.write(`data: ${data}\n\n`);
}; };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment