machty / ember-navigator

A better router/navigator for mobile Ember apps, inspired by React Navigation
Other
31 stars 3 forks source link

Provide MountedNode with a reference to its parent node #11

Open lukemelia opened 4 years ago

lukemelia commented 4 years ago

There are a few places where I've needed to access the parent node of a node. It is possible to do this by accessing the rootNode and traversing children, but is inefficient and not obvious. Would there be any downside in setting a mountedNode's parent on it as parentNode?

lukemelia commented 4 years ago

Let's take a look at node building libraries like nokogiri and learn from them about creating and maintaining parent-child relationships and use that to guide implementation.