From f79f4a2173b21c27057fdc47efec6657423e8ef7 Mon Sep 17 00:00:00 2001 From: Hung Pham Date: Thu, 16 Apr 2026 12:34:04 +0700 Subject: [PATCH] fix(Challenge 50): improve effect logic for price alert --- apps/signal/50-bug-in-effect/src/app/app.component.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/signal/50-bug-in-effect/src/app/app.component.ts b/apps/signal/50-bug-in-effect/src/app/app.component.ts index ec6ba09b0..e9105992a 100644 --- a/apps/signal/50-bug-in-effect/src/app/app.component.ts +++ b/apps/signal/50-bug-in-effect/src/app/app.component.ts @@ -40,11 +40,15 @@ export class AppComponent { gpu = model(false); constructor() { - /* + /* Explain for your junior team mate why this bug occurs ... */ effect(() => { - if (this.drive() || this.ram() || this.gpu()) { + const drive = this.drive(); + const ram = this.ram(); + const gpu = this.gpu(); + + if (drive || ram || gpu) { alert('Price increased!'); } });