Build real-time applications with PubNub pub/sub messaging
Does it follow best practices?
Evaluation — 88%
↑ 1.28xAgent success when using this tile
Validation for skill structure
A social media platform lets users follow other users and topics. When a user follows someone or a topic, they should receive real-time updates from that source. A power user might follow hundreds of accounts and dozens of topics. The platform needs to efficiently subscribe each user to all of their followed sources without opening an excessive number of individual channel connections. Additionally, when a user opens the app after being offline, the platform needs to show them recent posts they missed.
The engineering team needs a JavaScript module that manages a user's feed subscriptions efficiently. The module should handle adding and removing followed sources from a user's feed, subscribing to all of them at once, and fetching missed messages when the user comes back online.
Produce a single JavaScript file named feed-aggregator.js that exports:
Include inline comments explaining why certain PubNub features are chosen for managing large numbers of subscriptions.