tapquo/atoms

destroy an particular children (molecules/organism)

Closed this issue · 3 comments

I want to separate the issue in two things:

  • When a Atom call the method destroy the element it's destroyed. But if the Atom is part of Molecule still exist in the children property of the molecule. should it be removed from the list? Maybe doesn't destroy form the list by default but yes under determinate flag. (like destroy(yes))
  • In the molecule/organism exist the method destroyChildren, but the behavior is more as destroyAllChildren, I mean, (and in relation with the before issue) is not possible destroy a determinate children, just destroy all. At this moment I need this feature and I implemented it using remove method in Lodash: just I provide the uidand the children is destroyed:
remove: (award)->
    _.remove @children, (child) -> child.uid is award.uid

Why not separate the actual destroy in destroyAll and destroy inherited from lodash (documentation here, but in resume using a condition to destroy one or different childrens).

Good point!!! I'll work today in your approach :)

Fixed first issue -> c94dc50

Second one -> 31ca8e8