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 believe that extending from EventEmitter in ServiceProvider might not be necessary if we implement callbacks for communication between ServiceEmitter + ServiceProvider + CustomProvider. Using callbacks would be a cleaner and better implementation of ServiceProvider since ServiceEmitter is also extending from EventEmitter.
How so? well what if instead of listening wantsData event in some custom emitter we just override a method from ServiceProvider maybe called with the same name of the event (onWantsData())? the same could happen for data and error events used in ServiceEmitter.
The text was updated successfully, but these errors were encountered:
I believe that extending from
EventEmitter
inServiceProvider
might not be necessary if we implement callbacks for communication between ServiceEmitter + ServiceProvider + CustomProvider. Using callbacks would be a cleaner and better implementation ofServiceProvider
sinceServiceEmitter
is also extending fromEventEmitter
.How so? well what if instead of listening
wantsData
event in some custom emitter we just override a method fromServiceProvider
maybe called with the same name of the event (onWantsData()
)? the same could happen fordata
anderror
events used inServiceEmitter
.The text was updated successfully, but these errors were encountered: