Skip to main content

StateStatus

@webda/utils


Interface: StateStatus

Defined in: packages/utils/src/state.ts:18

Runtime state information tracked for an object decorated with State.

Properties​

lastTransition?​

optional lastTransition?: number

Defined in: packages/utils/src/state.ts:22

Timestamp (ms since epoch) of the last state transition.


state​

state: string

Defined in: packages/utils/src/state.ts:20

The current state name. Starts as "initial".


transitions​

transitions: object[]

Defined in: packages/utils/src/state.ts:24

Ordered history of completed state transitions.

duration​

duration: number

endTime​

endTime: number

exception?​

optional exception?: any

startTime​

startTime: number

step​

step: string

Methods​

updateState()​

updateState(newState, exception?): void

Defined in: packages/utils/src/state.ts:31

Record a transition to newState, appending an entry to transitions.

Parameters​

newState​

string

The new state name.

exception?​

any

Optional error that caused the transition.

Returns​

void