Skip to content

Commit

Permalink
DataTable: Change reactImmediately to react to eliminate console warn…
Browse files Browse the repository at this point in the history
…ing.

PiperOrigin-RevId: 555592557
  • Loading branch information
RyanMullins authored and LIT team committed Aug 11, 2023
1 parent d25392b commit 20d8caa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions lit_nlp/client/modules/data_table_module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,12 +396,11 @@ export class DataTableModule extends LitModule {
});
}

override firstUpdated() {
override connectedCallback() {
super.connectedCallback();
const updateColsChange = () =>
[this.appState.currentModels, this.appState.currentDataset, this.keys];
this.reactImmediately(updateColsChange, () => {
this.updateColumns();
});
[this.appState.currentModels, this.appState.currentDataset, this.keys];
this.react(updateColsChange, () => {this.updateColumns();});
}

private updateColumns() {
Expand Down
4 changes: 2 additions & 2 deletions lit_nlp/client/modules/scalar_module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export class ScalarModule extends LitModule {
}

override firstUpdated() {
this.reactImmediately(
this.react(
() => this.classificationService.allMarginSettings,
() => {
for (const [id, {model, key, xScale}] of this.plots.entries()) {
Expand Down Expand Up @@ -169,7 +169,7 @@ export class ScalarModule extends LitModule {
// the DataService instead.
this.dataService.dataVals
];
this.reactImmediately(getDataChanges, () => {
this.react(getDataChanges, () => {
for (const info of this.plots.values()) {
info.points?.clear();
delete info.points;
Expand Down

0 comments on commit 20d8caa

Please sign in to comment.