-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix event delegation (§4) #23
Comments
From @brodybits on July 5, 2018 14:50 Before evaluating I would have to do some research to see how the other modules, other functions do similar functionality such as:
I gotta say that this is starting to uncover some other lurking smells that should be noted and hopefully addressed at some point. For example:
I would be happy to deal with some of these items in separate issues. |
From @brodybits on July 6, 2018 23:22 @raphinesse thanks for the response with the nice picture. I read through your response pretty quickly, hope to process it in more depth next week. |
From @raphinesse on July 5, 2018 8:40
Current situation
Right at the start,
cordovaCreate
calls the following function with theextEvents
argument passed to it.Pain Points
cordovaCreate
w/outextEvents
subscribesCordovaLogger
toevents
again w/ no possibility to unsubscribe it.cordovaCreate
either.cordovaCreate
is tightly coupled to the Cordova event bus singleton.cordova-common
(e.g. during development with linked dependencies). Then we have multiple event buses with no sane way of choosing which one we want emit events on.Proposal
The only sane way I see is to accept an EventEmitter as an option (just as we do now), and only emit events there:
This would solve all problems described above.
We should also consider applying this pattern to other Cordova components.
Evolved from apache/cordova-discuss#89
Copied from original issue: apache/cordova-discuss#101
The text was updated successfully, but these errors were encountered: