shared-store
Advanced tools
Comparing version 1.0.10 to 1.0.11
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
99365
44
1107