Skip to content

Commit

Permalink
Merge pull request #34 from cesarParra/develop
Browse files Browse the repository at this point in the history
fix: isASignal function renamed to isSignal
  • Loading branch information
cesarParra authored Dec 18, 2024
2 parents b0f38c8 + 899ba02 commit 880f009
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions force-app/lwc/signals/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ class TrackedState {
return true;
}
}
const SIGNAL_OBJECT_BRAND = Symbol.for("lwc-signals");
/**
* Creates a new signal with the provided value. A signal is a reactive
* primitive that can be used to store and update values. Signals can be
Expand Down Expand Up @@ -233,7 +234,7 @@ function $signal(value, options) {
setter(newValue);
}
},
brand: Symbol.for("lwc-signals"),
brand: SIGNAL_OBJECT_BRAND,
readOnly: {
get value() {
return getter();
Expand Down Expand Up @@ -329,7 +330,7 @@ function $resource(fn, source, options) {
}
};
}
function isASignal(anything) {
return !!anything && anything.brand === Symbol.for("lwc-signals");
function isSignal(anything) {
return !!anything && anything.brand === SIGNAL_OBJECT_BRAND;
}
export { $signal, $effect, $computed, $resource, isASignal };
export { $signal, $effect, $computed, $resource, isSignal };

0 comments on commit 880f009

Please sign in to comment.