diff --git a/force-app/lwc/signals/core.js b/force-app/lwc/signals/core.js index 7886a9a..8f41b38 100644 --- a/force-app/lwc/signals/core.js +++ b/force-app/lwc/signals/core.js @@ -31,6 +31,9 @@ function $signal(value) { return _value; } function setter(newValue) { + if (newValue === _value) { + return; + } _value = newValue; for (const subscriber of subscribers) { subscriber(); diff --git a/src/lwc/signals/core.ts b/src/lwc/signals/core.ts index 7c49b0e..4d11ff7 100644 --- a/src/lwc/signals/core.ts +++ b/src/lwc/signals/core.ts @@ -52,6 +52,9 @@ function $signal(value: T): Signal { } function setter(newValue: T) { + if (newValue === _value) { + return; + } _value = newValue; for (const subscriber of subscribers) { subscriber();