8000 Temporary fix (a bug in `ready` event in the framework). · masteramuk/examples@5612829 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5612829

Browse files
committed
Temporary fix (a bug in ready event in the framework).
1 parent 9d7d280 commit 5612829

File tree

1 file changed

+45
-41
lines changed

1 file changed

+45
-41
lines changed

workflows/index.js

Lines changed: 45 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -7,49 +7,53 @@
77
// Requirements: Total.js +v2.3.0
88
require('total.js').load('debug', ['models', 'workflows']);
99

10-
// Async list
11-
var samples = [];
12-
13-
// Empty instance of User
14-
var user = CREATE('User');
15-
16-
samples.push(function(next) {
17-
console.log('---> begin $exec("user-save")');
18-
user.$exec('user-save', function(err, response) {
19-
console.log('---> end $exec("user-save") RESPONSE: ' + JSON.stringify(response));
20-
console.log();
21-
next();
10+
setTimeout(function() {
11+
12+
// Async list
13+
var samples = [];
< 10000 code>14+
15+
// Empty instance of User
16+
var user = CREATE('User');
17+
18+
samples.push(function(next) {
19+
console.log('---> begin $exec("user-save")');
20+
user.$exec('user-save', function(err, response) {
21+
console.log('---> end $exec("user-save") RESPONSE: ' + JSON.stringify(response));
22+
console.log();
23+
next();
24+
});
25+
});
26+
27+
samples.push(function(next) {
28+
console.log('---> begin $exec("array-results")');
29+
user.$exec('array-results', function(err, response) {
30+
console.log('---> end $exec("array-results") RESPONSE: ' + JSON.stringify(response));
31+
console.log();
32+
next();
33+
});
2234
});
23-
});
24-
25-
samples.push(function(next) {
26-
console.log('---> begin $exec("array-results")');
27-
user.$exec('array-results', function(err, response) {
28-
console.log('---> end $exec("array-results") RESPONSE: ' + JSON.stringify(response));
29-
console.log();
30-
next();
35+
36+
samples.push(function(next) {
37+
console.log('---> begin $exec("user-query")');
38+
user.$exec('user-query', function(err, response) {
39+
console.log('---> end $exec("user-query") RESPONSE: ' + JSON.stringify(response));
40+
console.log();
41+
next();
42+
});
3143
});
32-
});
33-
34-
samples.push(function(next) {
35-
console.log('---> begin $exec("user-query")');
36-
user.$exec('user-query', function(err, response) {
37-
console.log('---> end $exec("user-query") RESPONSE: ' + JSON.stringify(response));
38-
console.log();
39-
next();
44+
45+
samples.push(function(next) {
46+
console.log('---> begin $exec("xml")');
47+
user.$exec('xml', function(err, response) {
48+
console.log('---> end $exec("xml") RESPONSE: ' + JSON.stringify(response));
49+
console.log();
50+
next();
51+
});
4052
});
41-
});
42-
43-
samples.push(function(next) {
44-
console.log('---> begin $exec("xml")');
45-
user.$exec('xml', function(err, response) {
46-
console.log('---> end $exec("xml") RESPONSE: ' + JSON.stringify(response));
47-
console.log();
48-
next();
53+
54+
samples.async(function() {
55+
// Kills the app
56+
F.kill();
4957
});
50-
});
5158

52-
samples.async(function() {
53-
// Kills the app
54-
F.kill();
55-
});
59+
}, 1000);

0 commit comments

Comments
 (0)
0