context-state
Advanced tools
Comparing version 3.1.1 to 3.1.2
@@ -133,3 +133,3 @@ 'use strict'; | ||
var EMPTY = Symbol("EMPTY"); | ||
var __ContainerCache__ = /* @__PURE__ */ new WeakMap(); | ||
var __ContainerCache__ = /* @__PURE__ */ new Map(); | ||
function createContainer(useHook) { | ||
@@ -151,3 +151,6 @@ var equalityFn = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : shallowEqual; | ||
} | ||
__ContainerCache__.set(useHook, contextValue.current); | ||
if (__ContainerCache__.has(useHook.toString())) { | ||
__ContainerCache__["delete"](useHook.toString()); | ||
} | ||
__ContainerCache__.set(useHook.toString(), contextValue.current); | ||
useIsomorphicLayoutEffect(function() { | ||
@@ -178,3 +181,3 @@ var _contextValue_current; | ||
var __ContainerCache___get; | ||
var cached = (__ContainerCache___get = __ContainerCache__.get(useHook)) === null || __ContainerCache___get === void 0 ? void 0 : __ContainerCache___get[CONTEXT_VALUE]; | ||
var cached = (__ContainerCache___get = __ContainerCache__.get(useHook.toString())) === null || __ContainerCache___get === void 0 ? void 0 : __ContainerCache___get[CONTEXT_VALUE]; | ||
if (!cached) { | ||
@@ -181,0 +184,0 @@ throw new Error(ErrorText); |
@@ -151,3 +151,3 @@ 'use strict'; | ||
var EMPTY = Symbol("EMPTY"); | ||
var __ContainerCache__ = /* @__PURE__ */ new WeakMap(); | ||
var __ContainerCache__ = /* @__PURE__ */ new Map(); | ||
function createContainer(useHook) { | ||
@@ -169,3 +169,6 @@ var equalityFn = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : shallowEqual; | ||
} | ||
__ContainerCache__.set(useHook, contextValue.current); | ||
if (__ContainerCache__.has(useHook.toString())) { | ||
__ContainerCache__["delete"](useHook.toString()); | ||
} | ||
__ContainerCache__.set(useHook.toString(), contextValue.current); | ||
useIsomorphicLayoutEffect(function() { | ||
@@ -196,3 +199,3 @@ var _contextValue_current; | ||
var __ContainerCache___get; | ||
var cached = (__ContainerCache___get = __ContainerCache__.get(useHook)) === null || __ContainerCache___get === void 0 ? void 0 : __ContainerCache___get[CONTEXT_VALUE]; | ||
var cached = (__ContainerCache___get = __ContainerCache__.get(useHook.toString())) === null || __ContainerCache___get === void 0 ? void 0 : __ContainerCache___get[CONTEXT_VALUE]; | ||
if (!cached) { | ||
@@ -199,0 +202,0 @@ throw new Error(ErrorText); |
@@ -65,3 +65,3 @@ function _array_like_to_array(arr, len) { | ||
var EMPTY = Symbol("EMPTY"); | ||
var __ContainerCache__ = /* @__PURE__ */ new WeakMap(); | ||
var __ContainerCache__ = /* @__PURE__ */ new Map(); | ||
function createContainer(useHook) { | ||
@@ -83,3 +83,6 @@ var equalityFn = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : shallowEqual; | ||
} | ||
__ContainerCache__.set(useHook, contextValue.current); | ||
if (__ContainerCache__.has(useHook.toString())) { | ||
__ContainerCache__["delete"](useHook.toString()); | ||
} | ||
__ContainerCache__.set(useHook.toString(), contextValue.current); | ||
useIsomorphicLayoutEffect(function() { | ||
@@ -110,3 +113,3 @@ var _contextValue_current; | ||
var __ContainerCache___get; | ||
var cached = (__ContainerCache___get = __ContainerCache__.get(useHook)) === null || __ContainerCache___get === void 0 ? void 0 : __ContainerCache___get[CONTEXT_VALUE]; | ||
var cached = (__ContainerCache___get = __ContainerCache__.get(useHook.toString())) === null || __ContainerCache___get === void 0 ? void 0 : __ContainerCache___get[CONTEXT_VALUE]; | ||
if (!cached) { | ||
@@ -113,0 +116,0 @@ throw new Error(ErrorText); |
{ | ||
"name": "context-state", | ||
"version": "3.1.1", | ||
"version": "3.1.2", | ||
"description": "React state management library", | ||
@@ -51,22 +51,22 @@ "keywords": [ | ||
"devDependencies": { | ||
"@minko-fe/eslint-config": "^3.3.3", | ||
"@minko-fe/tsconfig": "^2.1.0", | ||
"@testing-library/react": "^16.0.0", | ||
"@types/node": "^18.19.43", | ||
"@types/react": "^18.3.3", | ||
"@minko-fe/eslint-config": "^4.0.2", | ||
"@minko-fe/tsconfig": "^2.1.1", | ||
"@swc/core": "^1.7.24", | ||
"@testing-library/react": "^16.0.1", | ||
"@types/node": "^18.19.50", | ||
"@types/react": "^18.3.5", | ||
"@types/react-dom": "^18.3.0", | ||
"@vitejs/plugin-react": "^4.3.1", | ||
"bumpp": "^9.4.2", | ||
"bumpp": "^9.5.2", | ||
"conventional-changelog-cli": "^5.0.0", | ||
"esbuild-plugin-replace": "^1.4.0", | ||
"eslint": "^9.8.0", | ||
"jsdom": "^24.1.1", | ||
"eslint": "^9.10.0", | ||
"jsdom": "^24.1.3", | ||
"react": "^18.3.1", | ||
"react-error-boundary": "^4.0.13", | ||
"taze": "^0.13.9", | ||
"terser": "^5.31.4", | ||
"taze": "^0.16.7", | ||
"tsup": "^8.2.4", | ||
"tsup-plugin-bundleless": "^0.4.0", | ||
"typescript": "^5.5.4", | ||
"vitest": "^1.6.0" | ||
"typescript": "^5.6.2", | ||
"vitest": "^2.0.5" | ||
}, | ||
@@ -73,0 +73,0 @@ "scripts": { |
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
73825
57
1596