You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a model named Page which can have multiple children, which in return can have its own children (and so on).
I would like to have a functiion like findChildren that would return (given a node/parent) children and its grandchildren in a nested array.
findDescendants is the function that will give you the result you are looking for but in a flat array.
That said I like the idea of creating a nested array from a flat array. I imagine it as a utility function that take the result of any function call and format it into a nested array tree.
I have a model named
Page
which can have multiple children, which in return can have its own children (and so on).I would like to have a functiion like
findChildren
that would return (given a node/parent) children and its grandchildren in a nested array.For example:
The text was updated successfully, but these errors were encountered: