react-use-sub
Advanced tools
Comparing version 2.1.1 to 2.2.0
@@ -38,6 +38,5 @@ 'use strict'; | ||
const _update = (D, next) => { | ||
const result = {}; | ||
D.keys.forEach((key) => { | ||
const p = D.data[key]; | ||
result[key] = key in next ? next[key] : p; | ||
const result = { ...D.data }; | ||
Object.keys(next).forEach((key) => { | ||
result[key] = next[key]; | ||
}); | ||
@@ -80,7 +79,5 @@ D.data = result; | ||
const createStore = (data) => { | ||
const keys = Object.keys(data); | ||
const D = { | ||
data, | ||
subs: new Set(), | ||
keys, | ||
}; | ||
@@ -87,0 +84,0 @@ const Store = _center(D); |
@@ -34,6 +34,5 @@ import { useRef, useCallback, useEffect, useState } from 'react'; | ||
const _update = (D, next) => { | ||
const result = {}; | ||
D.keys.forEach((key) => { | ||
const p = D.data[key]; | ||
result[key] = key in next ? next[key] : p; | ||
const result = { ...D.data }; | ||
Object.keys(next).forEach((key) => { | ||
result[key] = next[key]; | ||
}); | ||
@@ -76,7 +75,5 @@ D.data = result; | ||
const createStore = (data) => { | ||
const keys = Object.keys(data); | ||
const D = { | ||
data, | ||
subs: new Set(), | ||
keys, | ||
}; | ||
@@ -83,0 +80,0 @@ const Store = _center(D); |
{ | ||
"name": "react-use-sub", | ||
"version": "2.1.1", | ||
"version": "2.2.0", | ||
"description": "Subscription based lightweight React store", | ||
@@ -5,0 +5,0 @@ "engines": { |
Sorry, the diff of this file is not supported yet
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
25452
332