diff options
author | dan <dan.abramov@gmail.com> | 2024-05-28 16:37:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-28 16:37:51 +0100 |
commit | 9bd411c15159609803c4e8c3e352a9db32ea527c (patch) | |
tree | 31305e290bd4597aa6ab441ecc556999b19ad693 /src/lib/api/feed/following.ts | |
parent | 8a2f43c218c464e6165f331e482b6094b87eefc7 (diff) | |
download | voidsky-9bd411c15159609803c4e8c3e352a9db32ea527c.tar.zst |
Replace getAgent() with reading agent (#4243)
* Replace getAgent() with agent * Replace {agent} with agent
Diffstat (limited to 'src/lib/api/feed/following.ts')
-rw-r--r-- | src/lib/api/feed/following.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/api/feed/following.ts b/src/lib/api/feed/following.ts index 36c376554..1004ccfb8 100644 --- a/src/lib/api/feed/following.ts +++ b/src/lib/api/feed/following.ts @@ -3,14 +3,14 @@ import {AppBskyFeedDefs, BskyAgent} from '@atproto/api' import {FeedAPI, FeedAPIResponse} from './types' export class FollowingFeedAPI implements FeedAPI { - getAgent: () => BskyAgent + agent: BskyAgent - constructor({getAgent}: {getAgent: () => BskyAgent}) { - this.getAgent = getAgent + constructor({agent}: {agent: BskyAgent}) { + this.agent = agent } async peekLatest(): Promise<AppBskyFeedDefs.FeedViewPost> { - const res = await this.getAgent().getTimeline({ + const res = await this.agent.getTimeline({ limit: 1, }) return res.data.feed[0] @@ -23,7 +23,7 @@ export class FollowingFeedAPI implements FeedAPI { cursor: string | undefined limit: number }): Promise<FeedAPIResponse> { - const res = await this.getAgent().getTimeline({ + const res = await this.agent.getTimeline({ cursor, limit, }) |