Skip to content

Commit

Permalink
docs(catalog): batch signal changes
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 536855751
  • Loading branch information
Elliott Marquez authored and copybara-github committed May 31, 2023
1 parent 1a81d1e commit 60fe02e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions catalog/src/signals/signal-element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,14 @@ export function SignalElement<T extends ReactiveElementConstructor>(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();
}
});
}
};
Expand Down

0 comments on commit 60fe02e

Please sign in to comment.