Files
main.tsmain
What you'll learn
- Write an @Sse() handler that returns an Observable<MessageEvent>, and read the event-stream lines it produces
- Merge domain events from a subject with a periodic heartbeat, and explain what happens when the client disconnects
- Choose ReplaySubject, BehaviorSubject or Subject by what a late subscriber should see
Press Run tests to start the app. Its log appears here.Graded endpoints
A cat to adopt
Saved, then announced on the stream; nobody is listening yet, and the replaying subject keeps it
text/event-stream, read for a moment: the replayed adoption as an 'adopted' event with the cat, then heartbeats
Refused, so nothing is announced