Created
May 5, 2023 17:17
-
-
Save ggagosh/0850fd0100f17e2bc040095a917c0342 to your computer and use it in GitHub Desktop.
SSE warning example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Sse('sse') | |
sse() { | |
const subject = new Subject(); | |
setTimeout(() => { | |
Array.from(Array(1000).keys()).forEach((i) => { | |
subject.next({ | |
data: { | |
message: `Message #${i}`, | |
}, | |
}); | |
}); | |
}, 1000); | |
return subject; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment