Skip to content

Commit 63efa9c

Browse files
committed
0.1.5: Fixed subscription ready property
Fixes numtel#11
1 parent 8d7ce84 commit 63efa9c

File tree

3 files changed

+45
-42
lines changed

3 files changed

+45
-42
lines changed

.versions

Lines changed: 36 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,36 @@
1-
application-configuration@1.0.4
2-
autopublish@1.0.2
3-
base64@1.0.2
4-
binary-heap@1.0.2
5-
blaze@2.0.4
6-
blaze-tools@1.0.2
7-
callback-hook@1.0.2
8-
check@1.0.4
9-
ddp@1.0.14
10-
deps@1.0.6
11-
ejson@1.0.5
12-
follower-livedata@1.0.3
13-
geojson-utils@1.0.2
14-
html-tools@1.0.3
15-
htmljs@1.0.3
16-
id-map@1.0.2
17-
insecure@1.0.2
18-
jquery@1.11.3
19-
json@1.0.2
20-
local-test:numtel:mysql@0.1.4
21-
logging@1.0.6
22-
meteor@1.1.4
23-
minifiers@1.1.3
24-
minimongo@1.0.6
25-
mongo@1.0.11
26-
numtel:mysql@0.1.4
27-
observe-sequence@1.0.4
28-
ordered-dict@1.0.2
29-
random@1.0.2
30-
reactive-var@1.0.4
31-
retry@1.0.2
32-
sharlon:6to5@0.0.1
33-
spacebars-compiler@1.0.4
34-
templating@1.0.11
35-
test-helpers@1.0.3
36-
tinytest@1.0.4
37-
tracker@1.0.5
38-
underscore@1.0.2
1+
autopublish@1.0.3
2+
base64@1.0.3
3+
binary-heap@1.0.3
4+
blaze@2.1.2
5+
blaze-tools@1.0.3
6+
callback-hook@1.0.3
7+
check@1.0.5
8+
ddp@1.1.0
9+
deps@1.0.7
10+
ejson@1.0.6
11+
geojson-utils@1.0.3
12+
grigio:babel@0.1.1
13+
html-tools@1.0.4
14+
htmljs@1.0.4
15+
id-map@1.0.3
16+
insecure@1.0.3
17+
jquery@1.11.3_2
18+
json@1.0.3
19+
local-test:numtel:mysql@0.1.5
20+
logging@1.0.7
21+
meteor@1.1.6
22+
minifiers@1.1.5
23+
minimongo@1.0.8
24+
mongo@1.1.0
25+
numtel:mysql@0.1.5
26+
observe-sequence@1.0.6
27+
ordered-dict@1.0.3
28+
random@1.0.3
29+
reactive-var@1.0.5
30+
retry@1.0.3
31+
spacebars-compiler@1.0.6
32+
templating@1.1.1
33+
test-helpers@1.0.4
34+
tinytest@1.0.5
35+
tracker@1.0.7
36+
underscore@1.0.3

lib/LiveMysql.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
// numtel:mysql
22
// MIT License, ben@latenightsketches.com
33
// lib/LiveMysql.js
4+
var Future = Npm.require('fibers/future');
5+
46
LiveMysql = Npm.require('mysql-live-select');
57

68
// Convert the LiveMysqlSelect object into a cursor
79
LiveMysql.LiveMysqlSelect.prototype._publishCursor = function(sub) {
810
var self = this;
11+
var fut = new Future;
912
var initLength;
1013

1114
sub.onStop(function(){
@@ -23,7 +26,7 @@ LiveMysql.LiveMysqlSelect.prototype._publishCursor = function(sub) {
2326
self.on('update', function(rows){
2427
if(sub._ready === false){
2528
initLength = rows.length;
26-
if(initLength === 0) sub.ready();
29+
if(initLength === 0) fut['return']();
2730
}
2831
});
2932

@@ -43,9 +46,11 @@ LiveMysql.LiveMysqlSelect.prototype._publishCursor = function(sub) {
4346
selectHandler('added', 0, 1, function(){
4447
if(sub._ready === false &&
4548
self.data.length === initLength - 1){
46-
sub.ready();
49+
fut['return']();
4750
}
4851
});
4952
selectHandler('changed', 1, 2);
5053
selectHandler('removed', null, 1);
54+
55+
return fut.wait()
5156
}

package.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package.describe({
22
name: 'numtel:mysql',
33
summary: 'MySQL support with Reactive Select Subscriptions',
4-
version: '0.1.4',
4+
version: '0.1.5',
55
git: 'https://github.com/numtel/meteor-mysql.git'
66
});
77

@@ -32,7 +32,7 @@ Package.onTest(function(api) {
3232
'underscore',
3333
'autopublish',
3434
'insecure',
35-
'sharlon:6to5',
35+
'grigio:babel@0.1.1',
3636
'numtel:mysql'
3737
]);
3838
api.use('test-helpers'); // Did not work concatenated above

0 commit comments

Comments
 (0)