Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
coolio
Browse files Browse the repository at this point in the history
  • Loading branch information
KATT committed Oct 13, 2023
1 parent f6ca0ba commit 873aa64
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions examples/sse/src/app/api/sse/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ export function getResponseShape() {
async function* currentTimeGenerator() {
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
while (true) {
await sleep(100);
const date = new Date();
const hours = date.getHours();
const minutes = date.getMinutes();
const seconds = date.getSeconds();
const time = `${hours}:${minutes}:${seconds}`;
yield time;
yield new Intl.DateTimeFormat("en-US", {
hour: "numeric",
hour12: false,
minute: "numeric",
second: "numeric",
}).format(new Date());
await sleep(500);
}
}

Expand Down

0 comments on commit 873aa64

Please sign in to comment.