context-state
Advanced tools
Comparing version 2.3.1 to 2.4.0
@@ -67,3 +67,3 @@ "use strict"; | ||
var EMPTY = Symbol("EMPTY"); | ||
var __ContainerCache__; | ||
var __ContainerCache__ = /* @__PURE__ */ new WeakMap(); | ||
function createContainer(useHook) { | ||
@@ -75,10 +75,8 @@ var useSelector = function useSelector(selector) { | ||
if (context === EMPTY) { | ||
{ | ||
var __ContainerCache___get; | ||
var cached = (__ContainerCache___get = __ContainerCache__.get(__cache_key__)) === null || __ContainerCache___get === void 0 ? void 0 : __ContainerCache___get[CONTEXT_VALUE]; | ||
if (!cached) { | ||
throw new Error(ErrorText); | ||
} else { | ||
contextValue = cached; | ||
} | ||
var __ContainerCache___get; | ||
var cached = (__ContainerCache___get = __ContainerCache__.get(useHook)) === null || __ContainerCache___get === void 0 ? void 0 : __ContainerCache___get[CONTEXT_VALUE]; | ||
if (!cached) { | ||
throw new Error(ErrorText); | ||
} else { | ||
contextValue = cached; | ||
} | ||
@@ -126,6 +124,2 @@ } | ||
var Context = react.createContext(EMPTY); | ||
var __cache_key__; | ||
{ | ||
__cache_key__ = useHook.toString(); | ||
} | ||
var Provider = function(param) { | ||
@@ -143,10 +137,3 @@ var value = param.value, children = param.children; | ||
} | ||
{ | ||
{ | ||
if (!__ContainerCache__) { | ||
__ContainerCache__ = /* @__PURE__ */ new Map(); | ||
} | ||
} | ||
__ContainerCache__.set(__cache_key__, contextValue.current); | ||
} | ||
__ContainerCache__.set(useHook, contextValue.current); | ||
index_js.useIsomorphicLayoutEffect(function() { | ||
@@ -153,0 +140,0 @@ var _contextValue_current; |
@@ -66,3 +66,3 @@ function _arrayLikeToArray(arr, len) { | ||
var EMPTY = Symbol("EMPTY"); | ||
var __ContainerCache__; | ||
var __ContainerCache__ = /* @__PURE__ */ new WeakMap(); | ||
function createContainer(useHook) { | ||
@@ -74,10 +74,8 @@ var useSelector = function useSelector(selector) { | ||
if (context === EMPTY) { | ||
{ | ||
var __ContainerCache___get; | ||
var cached = (__ContainerCache___get = __ContainerCache__.get(__cache_key__)) === null || __ContainerCache___get === void 0 ? void 0 : __ContainerCache___get[CONTEXT_VALUE]; | ||
if (!cached) { | ||
throw new Error(ErrorText); | ||
} else { | ||
contextValue = cached; | ||
} | ||
var __ContainerCache___get; | ||
var cached = (__ContainerCache___get = __ContainerCache__.get(useHook)) === null || __ContainerCache___get === void 0 ? void 0 : __ContainerCache___get[CONTEXT_VALUE]; | ||
if (!cached) { | ||
throw new Error(ErrorText); | ||
} else { | ||
contextValue = cached; | ||
} | ||
@@ -125,6 +123,2 @@ } | ||
var Context = createContext(EMPTY); | ||
var __cache_key__; | ||
{ | ||
__cache_key__ = useHook.toString(); | ||
} | ||
var Provider = function(param) { | ||
@@ -142,10 +136,3 @@ var value = param.value, children = param.children; | ||
} | ||
{ | ||
{ | ||
if (!__ContainerCache__) { | ||
__ContainerCache__ = /* @__PURE__ */ new Map(); | ||
} | ||
} | ||
__ContainerCache__.set(__cache_key__, contextValue.current); | ||
} | ||
__ContainerCache__.set(useHook, contextValue.current); | ||
useIsomorphicLayoutEffect(function() { | ||
@@ -152,0 +139,0 @@ var _contextValue_current; |
{ | ||
"name": "context-state", | ||
"version": "2.3.1", | ||
"version": "2.4.0", | ||
"description": "React state management library", | ||
@@ -21,3 +21,2 @@ "keywords": [ | ||
"files": [ | ||
"CHANGELOG.md", | ||
"README.md", | ||
@@ -49,21 +48,21 @@ "dist" | ||
"devDependencies": { | ||
"@minko-fe/eslint-config": "^2.0.7", | ||
"@minko-fe/tsconfig": "^2.0.7", | ||
"@testing-library/react": "^14.0.0", | ||
"@types/node": "^18.15.10", | ||
"@types/react": "^18.2.45", | ||
"@types/react-dom": "^18.2.18", | ||
"@vitejs/plugin-react": "^3.1.0", | ||
"bumpp": "^9.0.0", | ||
"conventional-changelog-cli": "^2.2.2", | ||
"@minko-fe/eslint-config": "^2.2.2", | ||
"@minko-fe/tsconfig": "^2.0.8", | ||
"@testing-library/react": "^14.3.1", | ||
"@types/node": "^18.19.31", | ||
"@types/react": "^18.3.0", | ||
"@types/react-dom": "^18.3.0", | ||
"@vitejs/plugin-react": "^4.2.1", | ||
"bumpp": "^9.4.0", | ||
"conventional-changelog-cli": "^4.1.0", | ||
"esbuild-plugin-replace": "^1.4.0", | ||
"eslint": "^8.52.0", | ||
"jsdom": "^21.1.1", | ||
"react": "^18.2.0", | ||
"react-error-boundary": "^4.0.2", | ||
"taze": "^0.13.3", | ||
"terser": "^5.24.0", | ||
"eslint": "^8.57.0", | ||
"jsdom": "^21.1.2", | ||
"react": "^18.3.0", | ||
"react-error-boundary": "^4.0.13", | ||
"taze": "^0.13.7", | ||
"terser": "^5.30.4", | ||
"tsup": "^8.0.2", | ||
"typescript": "^5.0.2", | ||
"vitest": "^0.29.7" | ||
"typescript": "^5.4.5", | ||
"vitest": "^1.5.2" | ||
}, | ||
@@ -70,0 +69,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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
51602
44
1112