> Thanks, now makes sense. I get confused with the JsFunction JsType(native) > because elemental2 has some callbacks as JsFunction and others as > JsType(native), now an actual elemental2 question; what criteria is used to > apply JsFunction (ex. elemental2.Node.AddEventListenerCallback) instead of > JsType (ex. elemental2.JsType)? >
I think its the result of definition of EventTarget.addEventListener(): *listener - The object that receives a notification (an object that implements the Event <https://developer.mozilla.org/en-US/docs/Web/API/Event> interface) when an event of the specified type occurs. This must be an object implementing the EventListener <https://developer.mozilla.org/en-US/docs/Web/API/EventListener> interface, or simply a JavaScript function <https://developer.mozilla.org/en-US/docs/JavaScript/Guide/Functions>.* The EventListener interface is a defined API and thus a @JsType(isNative = true) interface has been generated. But to conform to "or simply a JavaScript function" there is also an AddEventListenerCallback that is a @JsFunction. Not sure if this distinction has any real value, in a hand coded elemental2 I would have only created a @JsFunction interface EventListener -- J. -- You received this message because you are subscribed to the Google Groups "GWT Contributors" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit-contributors/73b36bdb-c496-4768-a221-21fe8b5a437c%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
