New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@cycle/storage

Package Overview
Dependencies
Maintainers
4
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cycle/storage - npm Package Compare versions

Comparing version 5.0.3 to 5.1.0

test/.eslintrc

12

package.json
{
"name": "@cycle/storage",
"version": "5.0.3",
"version": "5.1.0",
"description": "A Cycle.js driver for localStorage and sessionStorage.",

@@ -20,2 +20,6 @@ "author": "Kahlil Lechelt",

"email": "ntilwalli@gmail.com"
},
{
"name": "Fabiano Taioli",
"email": "ftaioli@gmail.com"
}

@@ -31,4 +35,4 @@ ],

"devDependencies": {
"@cycle/dom": "^20.1.0",
"@types/node": "^8.0.19",
"@cycle/dom": "^22.8.0",
"@types/node": "^14.14.14",
"@types/tape": "^4.2.30",

@@ -48,3 +52,3 @@ "babel-preset-es2015": "^6.24.1",

"ts-node": "^3.3.0",
"typescript": "^2.4.2",
"typescript": "^4.1.3",
"xstream": "^11.0.0"

@@ -51,0 +55,0 @@ },

@@ -1,2 +0,2 @@

import {Stream} from 'xstream';
import xs, {Stream} from 'xstream';
import dropRepeats from 'xstream/extra/dropRepeats';

@@ -6,2 +6,23 @@ import {adapt} from '@cycle/run/lib/adapt';

const extStorageProducer = {
start: function (listener) {
this.sendReq = function(storage): void {
listener.next({
target: 'local',
key: storage.key,
value: storage.newValue
})
}
window.addEventListener('storage', this.sendReq)
},
stop: function () {
window.removeEventListener('storage', this.sendReq)
}
}
const extStorage$: Stream<StorageRequest> = typeof window !== "undefined"
? xs.create(extStorageProducer)
: xs.never()
function getStorage$(

@@ -12,3 +33,6 @@ request$: Stream<StorageRequest>,

if (type === 'local') {
return request$.filter(req => !req.target || req.target === 'local');
return xs.merge(
request$.filter(req => !req.target || req.target === 'local'),
extStorage$
);
} else {

@@ -15,0 +39,0 @@ return request$.filter(req => req.target === 'session');

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