[TIMOB-24612] Windows: Native-like event handling syntax for Hyperloop
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Medium |
Status | Open |
Resolution | Unresolved |
Affected Version/s | Hyperloop 2.1.0 |
Fix Version/s | n/a |
Components | Windows |
Labels | hyperloop-windows |
Reporter | Kota Iguchi |
Assignee | Kota Iguchi |
Created | 2017-04-21T01:12:22.000+0000 |
Updated | 2017-04-29T13:54:27.000+0000 |
Description
Currently we've been using Titanium-like
addEventListener
to handle native event, but we might want to use more "native-like" syntax for it.
click_event_ = component->Tapped += ref new TappedEventHandler([this, ctx](Platform::Object^ sender, TappedRoutedEventArgs^ e) {
// do something
});
*BEFORE*
component.addEventListener('Tapped', function(e) {
// do something
});
*AFTER*
component.Tapped += new TappedEventHandler(function(e) {
// do something
})
We might want to use +=
just like native code does instead of =
, because it clearly indicates we are "adding" something.
No comments