You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not quite sure whether this is a bug or intended behavior: A Publisher automatically listens to itself, "for convenience". For a Component, this call to listenTo() calls Publisher's subscribe, not LazyPublisher's - because it happens within initialization, if I'm correct. Additionally, LazyPublisher.subscribe checks for listeners.size == 1 rather than 0. Is this the way it was meant to be? If so, it is at least very obscure, and it would be nice of you to add some comment, because it's hard to tell from the code what's going on and how it should be used.
My current solution is to call listenTo(this) again in my Component subclass. This works for me, but is this how you intended it to be used? Is the calling of listenTo(this) in Publisher really a good thing? Maybe it makes things more complicated than it's worth... What do you think?
Christoph
The text was updated successfully, but these errors were encountered:
I'm not quite sure whether this is a bug or intended behavior: A Publisher automatically listens to itself, "for convenience". For a Component, this call to listenTo() calls Publisher's subscribe, not LazyPublisher's - because it happens within initialization, if I'm correct. Additionally, LazyPublisher.subscribe checks for listeners.size == 1 rather than 0. Is this the way it was meant to be? If so, it is at least very obscure, and it would be nice of you to add some comment, because it's hard to tell from the code what's going on and how it should be used.
My current solution is to call listenTo(this) again in my Component subclass. This works for me, but is this how you intended it to be used? Is the calling of listenTo(this) in Publisher really a good thing? Maybe it makes things more complicated than it's worth... What do you think?
Christoph
The text was updated successfully, but these errors were encountered: