Primitives / foldkit-primitives/state

PushOptions

interface · packages/primitives/src/state/history.ts:40

interface PushOptions<Value> {
  readonly capacity: number
  readonly group?: string | null | undefined
  readonly at?: number | undefined
  readonly within?: number | undefined
  readonly equals?: ((present: Value, value: Value) => boolean) | undefined
}

How push records a value.

Members

PushOptions.capacity

property · packages/primitives/src/state/history.ts:41

readonly capacity: number

PushOptions.group

property · packages/primitives/src/state/history.ts:43

readonly group?: string | null | undefined

Consecutive pushes of one group are one step; none stands alone.

PushOptions.at

property · packages/primitives/src/state/history.ts:45

readonly at?: number | undefined

When the push was made, in milliseconds: read for within, and kept for the next push.

PushOptions.within

property · packages/primitives/src/state/history.ts:51

readonly within?: number | undefined

With at: a push joins the group's step only when it comes within this many milliseconds of that group's previous push, so typing that pauses starts a new step. The Model holds no clock; the caller says what time it is.

PushOptions.equals

property · packages/primitives/src/state/history.ts:53

readonly equals?: ((present: Value, value: Value) => boolean) | undefined

A value equal to the present records nothing: the Model comes back as it was given.