How to combine React components with javascript module logic

(Ziker22) #1

Hi guys,
Lets say i have some business logic which is essentially a simple observer/publisher-subscriber pattern
Class Navigation is observing classes NavigationItem for various changes and also pushes notification to them. The thing is that Navigation as well as NavigationItem has also visual representation which should be shown to user.
i am wondering whats the best pattern to organize code to achieve this.

thx in advance

(Mikayel) #2

You can try the composite view pattern.