stevekrouse-robpikeio.web.val.run
Readme

robpike.io

A re-implementation of https://robpike.io/

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
export default async function(req: Request): Promise<Response> {
return new Response(
new ReadableStream({
async start(controller) {
for (let i = 0; i < 100; i++) {
controller.enqueue(new TextEncoder().encode("👋"));
await new Promise(r => setTimeout(r, 200));
}
controller.close();
},
}),
{
headers: {
"Content-Type": "text/event-stream",
},
},
);
}
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
v20
June 13, 2024