Search⌘ K
AI Features

Displaying Unread Notifications

Explore how to display unread notifications in a reactive chat room by managing multiple streams with RxJS. Learn to annotate and merge streams, carry state with scan, and update the UI dynamically as messages arrive or rooms change.

Time to add a final flourish: let’s display how many unread messages are waiting in each room.

Notifications

While not strictly needed for a chat room, it can be interesting to see how many new messages have shown up in a room that the user doesn’t have directly loaded.

Annotating streams

This feature is concerned with two streams: new messages and room loads.

The tricky part is that, while we want to listen in to multiple streams and store the state inside the observable stream (using merge and scan ...