AndreyAttr / Evo

Evo repo
MIT License
0 stars 1 forks source link

When added several DNA genes(Human, Ape) then clicking on one of them also cause changes into others. #55

Open AndreyAttr opened 7 years ago

AndreyAttr commented 7 years ago

2017-06-29_2354

AndreyAttr commented 7 years ago

@tapy-lappy, Please investigate

tapy-lappy commented 7 years ago

The reason lays in following: in AppComponent we register one instance of interaction service - IS(we use useClass sugared syntax) for all the tree of AppComponent's components. It means when we subscribe in our component-descendants on actions in that IS, we use Singleton pattern - so we have one instance of IS for all components. Because we use Observable we multicast notification for all the observers(subscribers). And it's a reason why we have this wrong behavior.

AndreyAttr commented 7 years ago

It blocks us with going on https://github.com/AndreyAttr/Evo/issues/63

AndreyAttr commented 7 years ago

@tapy-lappy, see my comment here: https://github.com/AndreyAttr/Evo/issues/63#issuecomment-316504046 I used tokens to solve my part of problem but it seems it's the same that you have here. You just need to invent smt. for collections. Because my solution still provide one SINGLETON instance of interaction service for your case with collection of genes. I remove blocker status because on #63 we can move further.