redux-state-sync
Advanced tools
Comparing version 1.0.3 to 1.0.4
{ | ||
"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 | ||
} | ||
} |
@@ -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); |
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
5350
8
84
10