Make WordPress Core

Changes between Version 2 and Version 3 of Ticket #21170, comment 32


Ignore:
Timestamp:
07/15/2012 03:30:09 PM (12 years ago)
Author:
carldanley
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #21170, comment 32

    v2 v3  
    33> The .namespace/identifier bit would only be used do identify the callback, so each "leaf" on the "branch" would have a name and we would be able to easily remove anonymous "leaves" by branch name + leaf name
    44
    5 I understand what you're saying now. The only question I have is how to we traverse the array to find simulated 'parents' and 'children'. If doAction( 'some.action' ) was called and we know there were several actions that existed such as 'some.action.a' and 'some.action.b', would we first find 'some.action' and then maybe look to a 'family' property that will indicate who the parent/children are? I don't think traversing each key in this flat array and determining who is prefixed with the correct action/identifier is the safest way, especially using for( var in ) to iterate. Thoughts?
     5I understand what you're saying now. The only question I have is how do we traverse the array to find simulated 'parents' and 'children'. If doAction( 'some.action' ) was called and we know there were several actions that existed such as 'some.action.a' and 'some.action.b', would we first find 'some.action' and then maybe look to a 'family' property that will indicate who the parent/children are? I don't think traversing each key in this flat array and determining who is prefixed with the correct action/identifier is the safest way, especially using for( var in ) to iterate. Thoughts?
    66
    77> If we create the nodes as instances of a small class, or even as simple objects, we can store the nodeType in each.