about summary refs log tree commit diff
path: root/src/lib/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/api')
-rw-r--r--src/lib/api/feed/demo.ts20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/lib/api/feed/demo.ts b/src/lib/api/feed/demo.ts
new file mode 100644
index 000000000..049e0f116
--- /dev/null
+++ b/src/lib/api/feed/demo.ts
@@ -0,0 +1,20 @@
+import {type AppBskyFeedDefs, type BskyAgent} from '@atproto/api'
+
+import {DEMO_FEED} from '#/lib/demo'
+import {type FeedAPI, type FeedAPIResponse} from './types'
+
+export class DemoFeedAPI implements FeedAPI {
+  agent: BskyAgent
+
+  constructor({agent}: {agent: BskyAgent}) {
+    this.agent = agent
+  }
+
+  async peekLatest(): Promise<AppBskyFeedDefs.FeedViewPost> {
+    return DEMO_FEED.feed[0]
+  }
+
+  async fetch(): Promise<FeedAPIResponse> {
+    return DEMO_FEED
+  }
+}