Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/rimbu/core/mod.ts>TraverseState

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
interface TraverseState
Re-export
import { type TraverseState } from "https://deno.land/x/rimbu@0.13.1/core/mod.ts";

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

Properties

readonly
halted: boolean

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

readonly
currentIndex: number

Returns the current index of the traversal.

Methods

nextIndex(): number

Increases the currentIndex of this traversal

halt(): void

Sets the halted value to true.

reset(): void

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

function TraverseState
Re-export
import { TraverseState } from "https://deno.land/x/rimbu@0.13.1/core/mod.ts";

Returns a new TraverseState instance, using optionally given startIndex as a start index value.

Parameters

optional
startIndex = [UNSUPPORTED]
  • (default: 0) the start index to use