Skip to main content
fetchRedditPost(subreddit, key): Promise<Ok<CacheHit, any> | Result<CacheHit, RedditParseException, false> | Result<CacheHit, FetchError, false>>
Defined in: packages/reddit-helpers/src/lib/reddit.ts:61 Fetches a Reddit post from a specified subreddit.

Parameters

subreddit

string The name of the subreddit this post belongs to.

key

string The key of the post to fetch.

Returns

Promise<Ok<CacheHit, any> | Result<CacheHit, RedditParseException, false> | Result<CacheHit, FetchError, false>> A promise that resolves to the RedditResponse object contained the fetched post.