Skip to content

Commit

Permalink
refactor: simplify value assignment in Signal set method
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed Dec 26, 2024
1 parent 9f3cbdb commit f6758c4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/signal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ export class Signal<T = any> implements Dependency, IWritableSignal<T> {
}

set(value: T): void {
if (this.currentValue !== (this.currentValue = value)) {
if (this.currentValue !== value) {
this.currentValue = value;
const subs = this.subs;
if (subs !== undefined) {
propagate(subs);
Expand Down

0 comments on commit f6758c4

Please sign in to comment.