Skip to main content

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.

PropertyTypeOptionalDescription
topicsRecord<string, Topic>YesA collection of topics indexed by their IDs.
widgetsRecord<string, any>YesA collection of widgets indexed by their IDs.
selectedTopicsstring[]YesAn array of IDs of the currently selected topics.
setSelectedTopicsReact.Dispatch<string[]>YesDispatch function to update the selected topics.
loadMoreFeedsbooleanYesFlag indicating whether more feeds can be loaded.
getNextPage() => Promise<void>YesFunction to fetch the next page of feeds.
feedListPost[]YesAn array of posts representing the feed list.
feedUsersListRecord<string, User>YesA collection of users indexed by their IDs.
deletePost(id: string) => Promise<void>YesFunction to delete a post by its ID.
pinPost(id: string) => Promise<void>YesFunction to pin a post by its ID.
likePost(id: string) => Promise<void>YesFunction to like a post by its ID.
clickNavigatorClickNavigatorYesHelper for navigation upon clicking certain elements.
hidePost(postId: string) => Promise<void>YesFunction to hide a post by its ID.
postComponentClickCustomCallback(event: React.MouseEvent<HTMLDivElement>) => voidYesCustom callback for post component click events.

Example

For example implementation, checkout here