Timeline

interface Timeline<T>

This is an abstraction for a timeline. Call init first!

Inheritors

Properties

Link copied to clipboard
abstract val state: Flow<TimelineState<T>>

The current state of the timeline.

Functions

Link copied to clipboard
abstract suspend fun dropAfter(roomId: RoomId, eventId: EventId): TimelineStateChange<T>

Drop all events after a given eventId.

Link copied to clipboard
abstract suspend fun dropBefore(roomId: RoomId, eventId: EventId): TimelineStateChange<T>

Drop all events before a given eventId.

Link copied to clipboard
abstract suspend fun init(roomId: RoomId, startFrom: EventId, configStart: GetTimelineEventConfig.() -> Unit = {}, configBefore: GetTimelineEventsConfig.() -> Unit = {}, configAfter: GetTimelineEventsConfig.() -> Unit = {}): TimelineStateChange<T>

Initialize the timeline with the start event.

Link copied to clipboard
abstract suspend fun loadAfter(config: GetTimelineEventsConfig.() -> Unit = {}): TimelineStateChange<T>

Load new events after the newest event. With default config this may suspend until at least one event can be loaded.

Link copied to clipboard
abstract suspend fun loadBefore(config: GetTimelineEventsConfig.() -> Unit = {}): TimelineStateChange<T>

Load new events before the oldest event. With default config this may suspend until at least one event can be loaded.