MCPcopy Create free account
hub / github.com/clintonwoo/hackernews-react-graphql / getFeed

Method getFeed

server/database/database.ts:108–115  ·  view source on GitHub ↗
(feedType: FeedType)

Source from the content-addressed store, hash-verified

106 }
107
108 async getFeed(feedType: FeedType): Promise<number[] | void> {
109 logger('Fetching', `/${feedType}stories.json`);
110
111 return get(child(this.db, `${feedType}stories`))
112 .then((feedSnapshot) => feedSnapshot.val())
113 .then((feed) => feed.filter((newsItem) => newsItem !== undefined && newsItem !== null))
114 .catch((reason) => logger('Fetching news feed failed:', reason));
115 }
116
117 /* BEGIN NEWS ITEMS */
118

Callers 1

rebuildFeedFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected