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

redux-state-sync

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redux-state-sync - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

__mocks__/envMock.js

21

package.json
{
"name": "redux-state-sync",
"version": "1.0.3",
"version": "1.0.4",
"description": "A middleware for redux to sync localstorage state in different tabs",

@@ -16,3 +16,7 @@ "main": "syncStorage.js",

"react",
"localstorage"
"localstorage",
"crosstab",
"sync",
"tabs",
"middleware"
],

@@ -26,2 +30,6 @@ "author": "AOHUA",

"devDependencies": {
"babel-cli": "^6.18.0",
"babel-jest": "^16.0.0",
"babel-polyfill": "^6.16.0",
"babel-preset-es2015": "^6.18.0",
"eslint": "^3.8.1",

@@ -31,7 +39,14 @@ "eslint-config-airbnb": "^12.0.0",

"eslint-plugin-jsx-a11y": "^2.2.3",
"eslint-plugin-react": "^6.4.1"
"eslint-plugin-react": "^6.4.1",
"jest": "^16.0.2"
},
"dependencies": {
"lodash": "^4.16.4"
},
"jest": {
"setupFiles": [
"./__mocks__/envMock.js"
],
"verbose": true
}
}

4

syncStorage.js

@@ -8,3 +8,3 @@ import indexOf from 'lodash/indexOf';

function timestampAction(action) {
export function timestampAction(action) {
const stampedAction = action;

@@ -21,2 +21,3 @@ stampedAction.$time = Date.now();

const stampedAction = timestampAction(action);
lastTimeStamp = stampedAction.$time;
localStorage.setItem(LAST_ACTION, JSON.stringify(stampedAction));

@@ -33,3 +34,2 @@ }

}
window.addEventListener('storage', (event) => {

@@ -36,0 +36,0 @@ const { stampedAction } = JSON.parse(event.newValue);

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