History

class History<T>(capacity: Int, initialEntries: List<T>)

Keeps track of historical values (i.e. of a Store) and allows you to navigate back in history

Parameters

capacity

max number of entries in history

initialEntries

initial entries in history

Constructors

Link copied to clipboard
fun <T> History(capacity: Int, initialEntries: List<T>)

Functions

Link copied to clipboard
fun back(): T

Gets the lastest history-entry that has been added and removes it from the history.

Link copied to clipboard
fun clear()

clears the history.

Link copied to clipboard
fun push(entry: T)

Pushes a new entry to the history

Properties

Link copied to clipboard
val available: Flow<Boolean>

Flow describing, if a value is available in the history

Link copied to clipboard
val current: List<T>

Represents the current entries in history.

Link copied to clipboard
val data: Flow<List<T>>

Gives a Flow with the entries of the history.