Skip to main content
fetchRedditPosts(subreddit, limit?): Promise<Ok<CacheHit, any> | Result<CacheHit, FetchError, boolean>>
Defined in: packages/reddit-helpers/src/lib/reddit.ts:36 Fetches Reddit posts from a specified subreddit.

Parameters

subreddit

string The name of the subreddit to fetch posts from.

limit?

number = 30 The amount of posts to fetch, defaults to 30

Returns

Promise<Ok<CacheHit, any> | Result<CacheHit, FetchError, boolean>> A promise that resolves to the RedditResponse object containing the fetched posts.