Skip to content

Recursive helper? #411

Description

@matthiasbeyer

Hi,

would it be possible to build a recursive helper for recursing on a tree-like structure?

E.G.:

{{recurse_with element.children tree}}
print something for {{element.value}}
{{/recurse_with}}

For a tree structure where

struct Tree {
  value: String,
  children: Vec<Tree>
}

For example? The first argument of the recurse_with helper would be a selector that gets the list of children nodes from a node.


To expand on that, I would like to implement depth-first and breadth-first recursion, but that shouldn't be too complicated if the basic helper is implemented.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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