src/timeline-window.js
function TimelineWindow(client, timelineSet, opts) {
    opts = opts || {};
    this._client = client;
    this._timelineSet = timelineSet;

    // these will be TimelineIndex objects; they delineate the 'start' and
    // 'end' of the window.
    //
    // _start.index is inclusive; _end.index is exclusive.
    this._start = null;
    this._end = null;

    this._eventCount = 0;
    this._windowLimit = opts.windowLimit || 1000;
}
function TimelineWindow(client, timelineSet, opts) {
    opts = opts || {};
    this._client = client;
    this._timelineSet = timelineSet;

    // these will be TimelineIndex objects; they delineate the 'start' and
    // 'end' of the window.
    //
    // _start.index is inclusive; _end.index is exclusive.
    this._start = null;
    this._end = null;

    this._eventCount = 0;
    this._windowLimit = opts.windowLimit || 1000;
}
function TimelineWindow ( client , timelineSet , opts ) { opts = opts || { } ; this . _client = client ; this . _timelineSet = timelineSet ; // these will be TimelineIndex objects; they delineate the 'start' and // 'end' of the window. // // _start.index is inclusive; _end.index is exclusive. this . _start = null ; this . _end = null ; this . _eventCount = 0 ; this . _windowLimit = opts . windowLimit || 1000 ; }
Construct a TimelineWindow.

<p>This abstracts the separate timelines in a Matrix {@link
module:models/room|Room} into a single iterable thing. It keeps track of
the start and endpoints of the window, which can be advanced with the help
of pagination requests.

<p>Before the window is useful, it must be initialised by calling {@link
module:timeline-window~TimelineWindow#load|load}.

<p>Note that the window will not automatically extend itself when new events
are received from /sync; you should arrange to call {@link
module:timeline-window~TimelineWindow#paginate|paginate} on {@link
module:client~MatrixClient.event:"Room.timeline"|Room.timeline} events.

@param {MatrixClient} client   MatrixClient to be used for context/pagination
requests.

@param {EventTimelineSet} timelineSet  The timelineSet to track

@param {Object} [opts] Configuration options for this window

@param {number} [opts.windowLimit = 1000] maximum number of events to keep
in the window. If more events are retrieved via pagination requests,
excess events will be dropped from the other end of the window.

@constructor
Construct a TimelineWindow .