Skip to main content

Class: Page<I, T\>

A page reddit returns from listings

example

const page = await r.subreddit("askreddit").hot({ count: 10 });
console.log(page.items.length); // 10
const nextPage = await page.next(20);
console.log(nextPage.items.length); // 20

Type parameters#

NameTypeDefault
IIdentified-
T-any

Properties#

items#

• items: I[]

Defined in: list/page.ts:25


r#

• r: Reddit

Defined in: list/page.ts:18

Methods#

fetch#

â–¸ fetch(): Promise<Page<I, T>>

Refetch the current page

Returns: Promise<Page<I, T>>

Defined in: list/page.ts:47


next#

â–¸ next(count: number): Promise<Page<I, T>>

Fetch next page after this

Parameters#

NameTypeDescription
countnumbercount of items

Returns: Promise<Page<I, T>>

Defined in: list/page.ts:63


prev#

â–¸ prev(count: number): Promise<Page<I, T>>

Fetch previous page before this

Parameters#

NameTypeDescription
countnumbercount of items

Returns: Promise<Page<I, T>>

Defined in: list/page.ts:79