Parse a JSON from Apex in Lightning Web Components

PHOTO EMBED

Mon Jun 27 2022 18:40:09 GMT+0000 (Coordinated Universal Time)

Saved by @gbritgs #lwc #apex

@wire(callout2Apex, {id: this.recordId})
function({ error, data }) {
  if (data) {
    this.arr = JSON.parse(data).keyFromJSON;
    this.loaded = true;
  } else if (error) {
    this.loaded = false;
  };
}
content_copyCOPY

An easy and quick way to parse objects without having to create DTO classes