Skip to main content
i found that i cant use @wire without setting cacheable=true.  But i dont want to cache the data... is there any solution?
2 answers
  1. Dec 29, 2019, 3:33 PM

    In javascript file.

    import connectToMethod from '@salesforce/apex/lwcController.methodToCall'

    @wire(connectToMethod, {recordId: '$recordId'})

    wiredData({error, data}){

    if( data ) {

    //Data handle

    }else{

    //Error handle

    }

    }

    In apex lwcController.cls create the method:

    @AuraEnabled

    public static Object methodToCall(String recordId){

    //Code

    }

     
0/9000