Skip to main content

interface TraverseState

An object used to track the state of a traversal, e.g. a forEach.

Properties

currentIndex

Returns the current index of the traversal.

Definition

readonly currentIndex: number;

halted

Returns true if the traversal has been halted by the user.

Definition

readonly halted: boolean;

Methods

halt

Sets the halted value to true.

Definition

halt(): void;

nextIndex

Returns the next index that the traversal should use

Definition

nextIndex(): number;

reset

Sets the halted value to false, and resets the currentIndex value to its start value.

Definition

reset(): void;