destroy an particular children (molecules/organism)
Closed this issue · 3 comments
Kikobeats commented
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 thechildren
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. (likedestroy(yes)
) - In the molecule/organism exist the method
destroyChildren
, but the behavior is more asdestroyAllChildren
, 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 usingremove
method in Lodash: just I provide theuid
and 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).
soyjavi commented
Good point!!! I'll work today in your approach :)