Skip to content

Depth of the currently traversed element in constant time #94

@mgoldenbe

Description

@mgoldenbe

Can I access the depth of the currently traversed (e.g. during the depth-first walk) element in constant time? Right now, the only way of getting the depth that I see (besides storing it with the node) is by calling getPath:

root.walk(el => {console.log(el.model.id, el.getPath().length);})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions