Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

shared-store

Package Overview
Dependencies
Maintainers
4
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shared-store - npm Package Compare versions

Comparing version 3.0.0 to 3.1.0

6

CHANGELOG.md

@@ -0,1 +1,7 @@

### 3.1.0
* Allow skipping all tmp files - **[@jkrems](https://github.com/jkrems)** [#39](https://github.com/groupon/shared-store/pull/39)
- [`ebf18c1`](https://github.com/groupon/shared-store/commit/ebf18c1d39172d5710f8edc84d6e2f9cdd2841c2) **feat:** Allow skipping all tmp files
### 3.0.0

@@ -2,0 +8,0 @@

16

lib/cache.js

@@ -157,3 +157,3 @@

activeLoader = function(meta, loader, tmpDir) {
activeLoader = function(meta, loader, tmpDir, writeCacheFiles) {
var data, fromCache, onDataLoaded, rawData, ref1, tearDownCrashHandler;

@@ -164,2 +164,9 @@ rawData = meta.flatMapLatest(loader).map(function(otherData) {

});
if (!writeCacheFiles) {
debug('skip writing a cache, returning raw data stream');
return rawData.distinctUntilChanged(property('data'), isEqual).publish();
}
debug('wrapping data stream in cache', {
tmpDir: tmpDir
});
ref1 = crashRecovery(tmpDir), onDataLoaded = ref1.onDataLoaded, tearDownCrashHandler = ref1.tearDownCrashHandler;

@@ -175,5 +182,8 @@ data = rawData.tap(onDataLoaded, tearDownCrashHandler, tearDownCrashHandler);

this.cachedLoader = function(meta, loader, tmpDir, active) {
this.cachedLoader = function(meta, loader, tmpDir, active, writeCacheFiles) {
if (writeCacheFiles == null) {
writeCacheFiles = true;
}
debug('cachedLoader(%j)', active);
loader = active ? activeLoader(meta, loader, tmpDir) : passiveLoader(tmpDir);
loader = active ? activeLoader(meta, loader, tmpDir, writeCacheFiles) : passiveLoader(tmpDir);
return Observable.create(function(observer) {

@@ -180,0 +190,0 @@ loader.subscribe(observer);

13

lib/shared-store.js

@@ -95,3 +95,3 @@

meta = _this._createMeta();
_this.stream = cachedLoader(meta, loader, _this._temp, _this._active);
_this.stream = cachedLoader(meta, loader, _this._temp, _this._active, _this._writeCacheFiles);
return _this.subscription = _this.stream.subscribe(_this._handleUpdate, _this._handleError);

@@ -103,7 +103,14 @@ };

this._cache = null;
this._writeCacheFiles = !!this._active;
this._retryTimeout = TEN_SECONDS;
}
SharedStore.prototype.setActive = function(_active) {
this._active = _active != null ? _active : true;
SharedStore.prototype.setActive = function(isActive) {
if (isActive == null) {
isActive = true;
}
this._active = !!isActive;
if (isActive && typeof isActive.writeCacheFiles === 'boolean') {
this._writeCacheFiles = isActive.writeCacheFiles;
}
return this._createStream();

@@ -110,0 +117,0 @@ };

{
"name": "shared-store",
"version": "3.0.0",
"version": "3.1.0",
"description": "Keeping config data in sync",

@@ -5,0 +5,0 @@ "license": "BSD-3-Clause",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc