Hi Michael,
When you do b.addEventListener - you're listening for events in b, not
in c. You should not, architecturally speaking, have b listen to
c at all - that's called tight coupling, which is bad. You should
instead do loose coupling, which would have your singleton class a
listen for
Thanks Jason. I wasn't sure if a listening for c and calling a function in
b as a result qualifies as tight coupling also between the three classes. In
any case, that was the other plan I had intended on going with. Thanks for the
great answer!
- MM
Merrill, Jason wrote:
Hi Michael,
When you do b.addEventListener - you're listening for events in b, not
in c. You should not, architecturally speaking, have b listen to
c at all - that's called tight coupling, which is bad.
So better to do the loose coupling thing I outlined
above.
Tight
3 matches
Mail list logo