diff --git a/button.js b/button.js index b98fe5d..70a596f 100644 --- a/button.js +++ b/button.js @@ -7,7 +7,7 @@ exports.View = title: "Buttons", elements: [ - { control: "button", caption: "Button", foreground: "CornflowerBlue", background: "Black", width: 125, binding: "text" }, + { control: "button", caption: "Button", foreground: "CornflowerBlue", background: "Black", binding: "text" }, { control: "button", resource: imgCloud, width: 125, height: 125, binding: "image" }, { control: "text", value: "{message}", fontsize: 12 }, ] @@ -33,14 +33,14 @@ exports.Commands = { viewModel.message = "Caption button"; yield Synchro.interimUpdateAwaitable(context); - yield Synchro.waitForAwaitable(context, waitInterval, 1000); + yield Synchro.yieldAwaitable(context, function(callback){ waitInterval(1000, callback) });; viewModel.message = ""; }, image: function * (context, session, viewModel) { viewModel.message = "Image button"; yield Synchro.interimUpdateAwaitable(context); - yield Synchro.waitForAwaitable(context, waitInterval, 1000); + yield Synchro.yieldAwaitable(context, function(callback){ waitInterval(1000, callback) });; viewModel.message = ""; }, } diff --git a/canvas.js b/canvas.js index 71d23b4..6eb1194 100644 --- a/canvas.js +++ b/canvas.js @@ -43,14 +43,14 @@ exports.Commands = { viewModel.message = "Red tapped"; yield Synchro.interimUpdateAwaitable(context); - yield Synchro.waitForAwaitable(context, waitInterval, 1000); + yield Synchro.yieldAwaitable(context, function(callback){ waitInterval(1000, callback) });; viewModel.message = ""; }, greenTapped: function * (context, session, viewModel) { viewModel.message = "Green tapped"; yield Synchro.interimUpdateAwaitable(context); - yield Synchro.waitForAwaitable(context, waitInterval, 1000); + yield Synchro.yieldAwaitable(context, function(callback){ waitInterval(1000, callback) });; viewModel.message = ""; }, } diff --git a/countdown.js b/countdown.js index 0086307..abb7a1d 100644 --- a/countdown.js +++ b/countdown.js @@ -31,7 +31,7 @@ exports.InitializeViewModel = function(context, session) exports.LoadViewModel = function * (context, session, viewModel) { - yield Synchro.waitForAwaitable(context, waitInterval, 4000); + yield Synchro.yieldAwaitable(context, function(callback){ waitInterval(4000, callback) });; viewModel.count = 10; viewModel.isLoading = false; } @@ -49,7 +49,7 @@ exports.Commands = while (viewModel.isCounting && (viewModel.count > 0)) { - yield Synchro.waitForAwaitable(context, waitInterval, 1000); + yield Synchro.yieldAwaitable(context, function(callback){ waitInterval(1000, callback) });; if (viewModel.isCounting) { viewModel.count--; diff --git a/image.js b/image.js index 3d21103..1900ad9 100644 --- a/image.js +++ b/image.js @@ -43,7 +43,7 @@ exports.Commands = viewModel.message = "Image tapped: " + params.count; var thisTap = ++viewModel.nextTap; yield Synchro.interimUpdateAwaitable(context); - yield Synchro.waitForAwaitable(context, waitInterval, 1000); + yield Synchro.yieldAwaitable(context, function(callback){ waitInterval(1000, callback) });; if (thisTap == viewModel.nextTap) { // If no other taps came in during the wait, then let's clear the message... diff --git a/list.js b/list.js index 4f8737a..3376b80 100644 --- a/list.js +++ b/list.js @@ -29,7 +29,7 @@ exports.InitializeViewModel = function(context, session) { itemToAdd: "", items: [ "white", "black", "yellow" ], - selectedItems: [ "black" ], + selectedItems: [ "black" ] } return viewModel; } diff --git a/react.js b/react.js index fd0f15f..a120d7b 100644 --- a/react.js +++ b/react.js @@ -31,5 +31,6 @@ exports.InitializeViewModel = function(context, session) exports.LoadViewModel = function * (context, session, viewModel) { - viewModel.responseData = JSON.parse((yield Synchro.waitForAwaitable(context, request, { url: REQUEST_URL }))[0].body); + var response = yield Synchro.yieldAwaitable(context, function(callback){ request({ url: REQUEST_URL }, callback) }); + viewModel.responseData = JSON.parse(response[0].body); } \ No newline at end of file diff --git a/react2.js b/react2.js index a580dfe..3b7bde8 100644 --- a/react2.js +++ b/react2.js @@ -45,5 +45,6 @@ exports.InitializeViewModel = function(context, session) exports.LoadViewModel = function * (context, session, viewModel) { - viewModel.responseData = JSON.parse((yield Synchro.waitForAwaitable(context, request, { url: REQUEST_URL }))[0].body); + var response = yield Synchro.yieldAwaitable(context, function(callback){ request({ url: REQUEST_URL }, callback) }); + viewModel.responseData = JSON.parse(response[0].body); } \ No newline at end of file