Hierarchy

  • PostStreamState

Constructors

Properties

animateScroll: boolean = false
description: string = ''

The description to render on the scrubber.

discussion: Discussion

The discussion to display the post stream for.

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: number = 0
loadNext: (() => void)

Type declaration

    • (): void
    • Returns void

loadPageTimeouts: Record<number, Timeout> = {}
loadPrevious: (() => void)

Type declaration

    • (): void
    • Returns void

loadPromise: null | Promise<void> = null
needsScroll: boolean = false
number: number = 1
pagesLoading: number = 0
paused: boolean = false

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

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

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

visibleEnd: number = 0
visibleStart: number = 0
loadCount: number = 20

The number of posts to load per page.

Methods

  • Check whether or not the scrubber should be disabled, i.e. if all of the posts are visible in the viewport.

    Returns boolean

  • 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>

  • 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>

  • 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>

  • Load a page of posts into the stream and redraw.

    Parameters

    • start: number
    • end: number
    • backwards: boolean = false

    Returns 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

  • Make sure that the given index is not outside of the possible range of indexes in the discussion.

    Parameters

    • index: number

    Returns number

Generated using TypeDoc v0.23.24