-
Notifications
You must be signed in to change notification settings - Fork 213
[RFC] Better events #38
Comments
I've been working with both approaches "generic events" and "specified events". As you said the generic events have one advantage - you can listen just for one event and receive multiple types of events using single line of code. Even if that sounds great, it's almost useless as in all of my apps I've had to do a conditional statement to check what exactly came in and decide what to do with it. I'm for the second approach as it gives more granularity and would keep the code clean. Honestly the solution which I liked the most is the one used by the Heyzap - https://github.com/Heyzap/heyzap-cordova/blob/master/docs/advanced.md which simply split all the events into "namespaces", so we would have something like:
|
Hello, Also I think the code would be cleaner. |
Awesome, I like the namespace idea, it could group the methods too. |
I think it is a great idea. |
I am working on next release to provide better API usage, one area to fix the emitted events.
I would like to hear some feedback for the following proposals before proceed,
1. Generic events between different ad-types. E.g.
AdLoaded
,AdFailed
events withadType
in the event data.Pros
AdFailed
Cons
AdRewarded
is only used by rewarded videoadType
need to be checked.2. Each ad-type has its own set of events. E.g,
BannerLoaded
,InterstitialFailed
events.Pros
adType
in the handling functionCons
I prefer (2) as it is more explicit, what do you think? @becvert @vintage @code4youreal @warcry2000
Maybe you have better idea.
The text was updated successfully, but these errors were encountered: