Platform Surface
Parameters
Observe A Live Object
This example observes one post and subscribes to the post topic after the first post snapshot is available.Observe A Live Collection
Use the collection callback to render the latest list. Keep the next-page function and call it only when the UI requests more data.Notes
getPost(),getMessage(),getChannel(),getCommunity(),getUser(),getPoll(),getRoom(), and similar singular methods follow the same live-object callback pattern.- Query methods such as
getPosts(),getComments(),getMessages(),getMembers(),getReactions(),getRooms(), andgetStreams()follow the live-collection callback pattern. - The callback can emit local/cache data before server data. Use
loading,error, andoriginif your UI needs to distinguish phases. - Keep topic subscriptions as narrow as possible. A post-detail screen should subscribe to the post topic; a community feed screen should subscribe to the community post topic.
- Always dispose the observer returned by the repository and any topic unsubscribe functions returned by
subscribeTopic().
Related Topics
Post Retrieval
See post-specific live object and collection usage.
TypeScript Real-time Events
Subscribe to social topics for cross-device updates.