Skip to content

Commit 24d0db7

Browse files
committed
Merge pull request NativeScript#1915 from NativeScript/feature/zone-0.6
Support for zone 0.6 callback wrapping
2 parents c6df0f7 + 3538acc commit 24d0db7

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

globals/globals.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,14 @@ global.loadModule = function(name: string): any {
2929
}
3030
}
3131

32-
global.zonedCallback = function(callback: Function): Function {
32+
global.zonedCallback = function (callback: Function): Function {
3333
if (global.zone) {
34+
// Zone v0.5.* style callback wrapping
3435
return global.zone.bind(callback);
36+
}
37+
if (global.Zone) {
38+
// Zone v0.6.* style callback wrapping
39+
return global.Zone.current.wrap(callback);
3540
} else {
3641
return callback;
3742
}

0 commit comments

Comments
 (0)