history

fun <T> WithJob.history(capacity: Int = 0, initialValue: List<T> = emptyList(), job: Job = this.job): History<T>

factory-method to create a History

Parameters

capacity

max number of entries in history

initialValue

initial content of the history

job

Job to be used by the History


fun <D> Store<D>.history(capacity: Int = 0, initialEntries: List<D> = emptyList(), job: Job = this.job, synced: Boolean = true): History<D>

factory-method to create a History synced with the given Store, so that each update is automatically stored in history.

Receiver

Store to sync with

Parameters

capacity

max number of entries in history

initialEntries

initial entries in history

job

Job to be used by the History

synced

if true, the history will sync with store updates