LWCのjavaScriptとAPEXの同期処理方法

 

note.com

同期処理

async関数の中で、awaitしても同じ結果になると言うことです。

 


import
ApexMethod1 from '@salesforce/apex/ApexClass.ApexMethod1';
import ApexMethod2 from '@salesforce/apex/ApexClass.ApexMethod2';
import ApexMethod3 from '@salesforce/apex/ApexClass.ApexMethod3';
async handleOKClick(event) {
// Apexクラスのメソッドを呼び出す
const result1 = await ApexMethod1({param: 1});
const result2 = await ApexMethod2({param: 2});
const result3 = await ApexMethod3({param: 3}) }