Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • PostStreamState

Index

Constructors

constructor

Properties

animateScroll

animateScroll: boolean = false

description

description: string = ''

The description to render on the scrubber.

discussion

discussion: Discussion

The discussion to display the post stream for.

forceUpdateScrubber

forceUpdateScrubber: boolean = false

When the page is scrolled, goToIndex is called, or the page is loaded, various listeners result in the scrubber being updated with a new position and values. However, if goToNumber is called, the scrubber will not be updated. Accordingly, we add logic to the scrubber's onupdate to update itself, but only when needed, as indicated by this property.

index

index: number = 0

loadNext

loadNext: () => void

Type declaration

    • (): void
    • Returns void

loadPageTimeouts

loadPageTimeouts: Record<number, Timeout> = {}

loadPrevious

loadPrevious: () => void

Type declaration

    • (): void
    • Returns void

loadPromise

loadPromise: null | Promise<void> = null

needsScroll

needsScroll: boolean = false

number

number: number = 1

pagesLoading

pagesLoading: number = 0

paused

paused: boolean = false

Whether or not the infinite-scrolling auto-load functionality is disabled.

targetPost

targetPost: null | { number: number } | { index: number; reply?: boolean } = null

visible

visible: number = 1

The number of posts that are currently visible in the viewport.

visibleEnd

visibleEnd: number = 0

visibleStart

visibleStart: number = 0

Static loadCount

loadCount: number = 20

The number of posts to load per page.

Methods

_loadNext

  • _loadNext(): void

_loadPrevious

  • _loadPrevious(): void

count

  • count(): number

disabled

  • disabled(): boolean

goToFirst

goToIndex

  • goToIndex(index: number, noAnimation?: boolean): Promise<void>

goToLast

goToNumber

  • goToNumber(number: number | "reply", noAnimation?: boolean): Promise<void>
  • Load and scroll to a post with a certain number.

    Parameters

    • number: number | "reply"

      The post number to go to. If 'reply', go to the last post and scroll the reply preview into view.

    • noAnimation: boolean = false

    Returns Promise<void>

loadNearIndex

  • loadNearIndex(index: number): Promise<void>
  • Clear the stream and load posts near a certain index. A page of posts surrounding the given index will be loaded. Returns a promise. If the given index is already loaded, the promise will be resolved immediately.

    Parameters

    • index: number

    Returns Promise<void>

loadNearNumber

  • loadNearNumber(number: number): Promise<void>
  • Clear the stream and load posts near a certain number. Returns a promise. If the post with the given number is already loaded, the promise will be resolved immediately.

    Parameters

    • number: number

    Returns Promise<void>

loadPage

  • loadPage(start: number, end: number, backwards?: boolean): void

loadRange

posts

  • posts(): (null | Post)[]

reset

  • reset(start?: number, end?: number): void
  • Reset the stream so that a specific range of posts is displayed. If a range is not specified, the first page of posts will be displayed.

    Parameters

    • Optional start: number
    • Optional end: number

    Returns void

sanitizeIndex

  • sanitizeIndex(index: number): number

show

  • show(posts: Post[]): void

update

viewingEnd

  • viewingEnd(): boolean

Generated using TypeDoc version 0.22.10