From 60fe02e44d421974893b00a54eb82dcb37ac5d85 Mon Sep 17 00:00:00 2001 From: Elliott Marquez Date: Wed, 31 May 2023 16:29:30 -0700 Subject: [PATCH] docs(catalog): batch signal changes PiperOrigin-RevId: 536855751 --- catalog/src/signals/signal-element.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/catalog/src/signals/signal-element.ts b/catalog/src/signals/signal-element.ts index 018b8ed857..f083b68cb6 100644 --- a/catalog/src/signals/signal-element.ts +++ b/catalog/src/signals/signal-element.ts @@ -28,9 +28,14 @@ export function SignalElement(Base: T): return; } this._disposeEffect?.(); + let performingUpdate = true; this._disposeEffect = effect(() => { - this.isUpdatePending = true; - super.performUpdate(); + if (performingUpdate) { + performingUpdate = false; + super.performUpdate(); + } else { + this.requestUpdate(); + } }); } };