From 1061b6efff731d85241c1a55e0aae3f9225e4f68 Mon Sep 17 00:00:00 2001 From: Seth Trowbridge Date: Mon, 23 Oct 2023 11:00:00 -0400 Subject: [PATCH] add deep equality for hrm signals --- deno.jsonc | 6 +++--- hmr-signal.tsx | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/deno.jsonc b/deno.jsonc index 1837ba3..5c84f45 100644 --- a/deno.jsonc +++ b/deno.jsonc @@ -1,8 +1,8 @@ { "imports": { - "react": "https://esm.sh/preact@10.17.1/compat", - "react-original": "https://esm.sh/preact@10.17.1/compat", - "react/": "https://esm.sh/preact@10.17.1/compat/", + "react": "https://esm.sh/preact@10.18.1/compat", + "react-original": "https://esm.sh/preact@10.18.1/compat", + "react/": "https://esm.sh/preact@10.18.1/compat/", "@preact/signals": "https://esm.sh/@preact/signals@1.2.1", "signals-original": "https://esm.sh/@preact/signals@1.2.1", "@twind/core": "https://esm.sh/@twind/core@1.1.3", diff --git a/hmr-signal.tsx b/hmr-signal.tsx index 28703a9..b37f696 100644 --- a/hmr-signal.tsx +++ b/hmr-signal.tsx @@ -1,4 +1,5 @@ import * as SignalsParts from "signals-original"; +import DeepEqual from "https://esm.sh/deep-eql@4.1.3"; type Entry = [signal:SignalsParts.Signal, initArg:T]; @@ -16,7 +17,7 @@ function ProxyGroup(inFunc:(initArg:T)=>SignalsParts.Signal) const proxy =(arg:T)=> { const lookupOld = recordEntry[recordIndex]; - if(lookupOld && lookupOld[1] === arg) + if(lookupOld && DeepEqual(lookupOld[1], arg)) { recordEntryNew[recordIndex] = lookupOld; recordIndex++; -- 2.34.1