mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 19:26:42 +08:00
setTimeout and setInterval are now more TypeScript like
This commit is contained in:
@ -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]) {
|
||||
|
Reference in New Issue
Block a user