what would be the simpliest way to communicate between independent classes?
I have been searching for two days and couldn’t find nothing,
isn’t there a way that one class has a dispatchEvent and the other an addEventListener, with a custom Event?? I could only find solutions within the same class o with a parentchild relationship, but what I’m looking for is like a “brother” relationship so to speak
thanks
what would be the simpliest way to communicate between independent classes? I have been
Share
So if you have ChildClass1, ChildClass2, and ParentClass, where ChildClass1 and ChildClass2 are both the children of ParenClass.
ChildClass1 will dispatch an event.
ParentClass will listen for this event, and then it’s handler will update ChildClass2.