Comparing version 4.0.9 to 4.0.10
@@ -43,2 +43,3 @@ "use strict"; | ||
const STASH_MEMO = 4; | ||
const STASH_REF = 5; | ||
const resolvedPromiseValueMap = /* @__PURE__ */ new WeakMap(); | ||
@@ -230,3 +231,11 @@ const isDepsChanged = (prevDeps, deps) => !prevDeps || !deps || prevDeps.length !== deps.length || deps.some((dep, i) => dep !== prevDeps[i]); | ||
const useRef = (initialValue) => { | ||
return { current: initialValue }; | ||
var _a; | ||
const buildData = import_render.buildDataStack.at(-1); | ||
if (!buildData) { | ||
return { current: initialValue }; | ||
} | ||
const [, node] = buildData; | ||
const refArray = (_a = node[import_constants.DOM_STASH][1])[STASH_REF] || (_a[STASH_REF] = []); | ||
const hookIndex = node[import_constants.DOM_STASH][0]++; | ||
return refArray[hookIndex] || (refArray[hookIndex] = { current: initialValue }); | ||
}; | ||
@@ -233,0 +242,0 @@ const use = (promise) => { |
@@ -9,2 +9,3 @@ // src/jsx/hooks/index.ts | ||
var STASH_MEMO = 4; | ||
var STASH_REF = 5; | ||
var resolvedPromiseValueMap = /* @__PURE__ */ new WeakMap(); | ||
@@ -196,3 +197,11 @@ var isDepsChanged = (prevDeps, deps) => !prevDeps || !deps || prevDeps.length !== deps.length || deps.some((dep, i) => dep !== prevDeps[i]); | ||
var useRef = (initialValue) => { | ||
return { current: initialValue }; | ||
var _a; | ||
const buildData = buildDataStack.at(-1); | ||
if (!buildData) { | ||
return { current: initialValue }; | ||
} | ||
const [, node] = buildData; | ||
const refArray = (_a = node[DOM_STASH][1])[STASH_REF] || (_a[STASH_REF] = []); | ||
const hookIndex = node[DOM_STASH][0]++; | ||
return refArray[hookIndex] || (refArray[hookIndex] = { current: initialValue }); | ||
}; | ||
@@ -199,0 +208,0 @@ var use = (promise) => { |
{ | ||
"name": "hono", | ||
"version": "4.0.9", | ||
"version": "4.0.10", | ||
"description": "Ultrafast web framework for the Edges", | ||
@@ -5,0 +5,0 @@ "main": "dist/cjs/index.js", |
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
701626
19293