Answer the question
In order to leave comments, you need to log in
Call chain in object dependency tree
Suggest a pattern or algorithm for the following task: there are a number of objects that are logically connected to each other in the likeness of a tree. With a certain change in one of them, a parent method may be called, which in turn may also change and call a method from its parent (or may not call a test by condition). This happens along the chain of relationships in the tree. Also, the call can come from parents, while branching is possible (calling several methods from different objects). There should be no cycles (they are not in the interconnection logic): that is, the call goes in one direction and cannot return to the original one. The division into parents and descendants is conditional for this task, there is no inheritance. Preferably OOP. With JS, I'm at a beginner level.
Answer the question
In order to leave comments, you need to log in
It seems that you need a pattern that is either Observer or PubSub.
Observer , or, as its kind, an event emitter with bubbling and capturing events, like in dom?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question