function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
punit tyagi 12punit tyagi 12 

used wired method in lwc or imparative method in lwc

Is calling wired method in lwc is good practices. or imperative method ?

 

 

 

VinayVinay (Salesforce Developers) 
Hi Punit,

Lightning web components can import methods from Apex classes. The imported methods are functions that the component can call either via @wire or imperatively.  You can use either of them.

https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.apex_wire_method
https://developer.salesforce.com/docs/component-library/documentation/en/lwc/apex

Please mark as Best Answer if above information was helpful.

Thanks,
Robert John 5Robert John 5
 the complete Taco Bell Menu Breakfast with prices 2022 and a regular Menu for you to browse from the comfort of your home.