Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24612] Windows: Native-like event handling syntax for Hyperloop

GitHub Issuen/a
TypeImprovement
PriorityMedium
StatusOpen
ResolutionUnresolved
Affected Version/sHyperloop 2.1.0
Fix Version/sn/a
ComponentsWindows
Labelshyperloop-windows
ReporterKota Iguchi
AssigneeKota Iguchi
Created2017-04-21T01:12:22.000+0000
Updated2017-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.

Comments

No comments

JSON Source