0

I have an LWC integrated into my CRM analytics dashboard that displays data based on a compare table. The LWC is designed to display specific data based on global filter selections made by the user, and the query behind it is being updated accordingly.

The issue is that the LWC doesn't update in real-time when the global filter in the dashboard is changed. Instead, it's always one step behind, i.e., it reflects the previous filter selection.

It's currently being updated using:

  @api stateChangedCallback(prevState, newState) {
    this.currentState = newState;
    this.recalculate();
    }

Any insights or suggestions would be greatly appreciated. Thank you!

1 Answer 1

0

I ended up using an alternative approach and got around the delay:

@api
  get results() {
    return this._results;
  }

  set results(results) {
    this._results = results;
    if (results !== undefined && results !== null) {
      this.recalculate();
    }
  }

I'm still using stateChangedCallback() for other behaviors, but for data updates that seems to be the way.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .