Replace getAgent() with reading agent (#4243)

* Replace getAgent() with agent

* Replace {agent} with agent
This commit is contained in:
dan
2024-05-28 16:37:51 +01:00
committed by GitHub
parent 8a2f43c218
commit 9bd411c151
74 changed files with 400 additions and 438 deletions
+8 -8
View File
@@ -27,7 +27,7 @@ export const FALLBACK_MARKER_POST: AppBskyFeedDefs.FeedViewPost = {
}
export class HomeFeedAPI implements FeedAPI {
getAgent: () => BskyAgent
agent: BskyAgent
following: FollowingFeedAPI
discover: CustomFeedAPI
usingDiscover = false
@@ -36,24 +36,24 @@ export class HomeFeedAPI implements FeedAPI {
constructor({
userInterests,
getAgent,
agent,
}: {
userInterests?: string
getAgent: () => BskyAgent
agent: BskyAgent
}) {
this.getAgent = getAgent
this.following = new FollowingFeedAPI({getAgent})
this.agent = agent
this.following = new FollowingFeedAPI({agent})
this.discover = new CustomFeedAPI({
getAgent,
agent,
feedParams: {feed: PROD_DEFAULT_FEED('whats-hot')},
})
this.userInterests = userInterests
}
reset() {
this.following = new FollowingFeedAPI({getAgent: this.getAgent})
this.following = new FollowingFeedAPI({agent: this.agent})
this.discover = new CustomFeedAPI({
getAgent: this.getAgent,
agent: this.agent,
feedParams: {feed: PROD_DEFAULT_FEED('whats-hot')},
userInterests: this.userInterests,
})