setTimeout and setInterval are now more TypeScript like

This commit is contained in:
Vladimir Enchev
2014-05-14 16:01:03 +03:00
parent 8c8bbd6bb0
commit c2a18eb857
2 changed files with 4 additions and 4 deletions

View File

@ -6,7 +6,7 @@ var timeoutCallbacks = {};
function createTimerAndGetId(callback: Function, milliseconds: number, shouldRepeat: boolean): number {
var id = new Date().getUTCMilliseconds();
var target = Foundation.NSObject.extends({ tick: function (timer) { callback(); } }, { exposedMethods: { "tick:": "v@:@" } });
var target = Foundation.NSObject.extends({ tick: (timer) => { callback(); } }, { exposedMethods: { "tick:": "v@:@" } });
var timer = Foundation.NSTimer.scheduledTimerWithTimeIntervalTargetSelectorUserInfoRepeats(milliseconds / 1000, new target(), "tick:", null, shouldRepeat);
if (!timeoutCallbacks[id]) {