shared-store
Advanced tools
Comparing version
@@ -0,1 +1,6 @@ | ||
1.0.11 | ||
------ | ||
* emit correct @_options to meta - @chkhoo #20 | ||
* fix when store.init errors, fetches from cache & getCurrent is null - @chkhoo #19 | ||
1.0.10 | ||
@@ -2,0 +7,0 @@ ------ |
@@ -113,13 +113,18 @@ // Generated by CoffeeScript 1.9.0 | ||
return function(resolve, reject) { | ||
var current, originalErr; | ||
current = _this.getCurrent(); | ||
if (current != null) { | ||
return resolve(current); | ||
} | ||
originalErr = null; | ||
return _this.stream.take(1).map(property('data')).tapOnError(function(err) { | ||
return originalErr = err; | ||
})["catch"](latestCacheFile(_this._temp)).subscribe(resolve, function(err) { | ||
return reject(originalErr); | ||
}); | ||
var handleData, handleErr; | ||
handleData = function(data) { | ||
_this.removeListener('err', handleErr); | ||
return resolve(data); | ||
}; | ||
handleErr = function(err) { | ||
_this.removeListener('data', handleData); | ||
return latestCacheFile(_this._temp).subscribe(function(cache) { | ||
_this._handleUpdate(cache); | ||
return resolve(cache.data); | ||
}, function() { | ||
return reject(err); | ||
}); | ||
}; | ||
_this.once('data', handleData); | ||
return _this.once('err', handleErr); | ||
}; | ||
@@ -174,3 +179,3 @@ })(this)); | ||
this._createStream(); | ||
this.emit('meta', this.options); | ||
this.emit('meta', this._options); | ||
this._retryTimeout *= RETRY_MULTIPLIER; | ||
@@ -177,0 +182,0 @@ if (this._retryTimeout > TEN_MINUTES) { |
{ | ||
"name": "shared-store", | ||
"version": "1.0.10", | ||
"version": "1.0.11", | ||
"description": "Keeping config data in sync", | ||
@@ -5,0 +5,0 @@ "main": "lib/shared-store.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
99365
2.31%44
2.33%1107
0.45%