Skip to content

Commit

Permalink
Bump v1.0.14
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielmbmb committed Sep 18, 2020
1 parent 95a7bf8 commit e090826
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vuex-multi-tab-state",
"version": "1.0.13",
"version": "1.0.14",
"description": "Share and synchronize status between multiple tabs with this plugin for Vuex.",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ export default function(options?: Options) {
// if whole state is to be replaced then do just that
if (statesPaths.length === 0) return { ...newState };
// else take old state
let merged = { ...oldState };
const merged = { ...oldState };
// and replace only specified paths
for (const statePath of statesPaths) {
statesPaths.forEach(statePath => {
const newValue = _get(newState, statePath);
// remove value if it doesn't exist, overwrite otherwise
if (typeof newValue === 'undefined') _unset(merged, statePath);
else _set(merged, statePath, newValue);
}
});
return merged;
}

Expand Down

0 comments on commit e090826

Please sign in to comment.