LMFeedDataContext
Introduction
The LMFeedDataContext
houses all the posts and its details, that has been loaded on the page. You can use these values to implement a custom-feed scrolling component, or you can fetch details of any post through this. By default, The SDK uses this internally to implement scroll-view for Social
and QnA
feeds.
Property | Type | Optional | Description |
---|---|---|---|
topics | Record<string, Topic> | Yes | A collection of topics indexed by their IDs. |
widgets | Record<string, any> | Yes | A collection of widgets indexed by their IDs. |
selectedTopics | string[] | Yes | An array of IDs of the currently selected topics. |
setSelectedTopics | React.Dispatch<string[]> | Yes | Dispatch function to update the selected topics. |
loadMoreFeeds | boolean | Yes | Flag indicating whether more feeds can be loaded. |
getNextPage | () => Promise<void> | Yes | Function to fetch the next page of feeds. |
feedList | Post[] | Yes | An array of posts representing the feed list. |
feedUsersList | Record<string, User> | Yes | A collection of users indexed by their IDs. |
deletePost | (id: string) => Promise<void> | Yes | Function to delete a post by its ID. |
pinPost | (id: string) => Promise<void> | Yes | Function to pin a post by its ID. |
likePost | (id: string) => Promise<void> | Yes | Function to like a post by its ID. |
clickNavigator | ClickNavigator | Yes | Helper for navigation upon clicking certain elements. |
hidePost | (postId: string) => Promise<void> | Yes | Function to hide a post by its ID. |
postComponentClickCustomCallback | (event: React.MouseEvent<HTMLDivElement>) => void | Yes | Custom callback for post component click events. |
Example
For example implementation, checkout here