Loading tutorials
@AuraEnabled annotation is how an Apex method becomes callable from a component, and the cacheable=true option makes that method usable with @wire. This chapter covers how to w6 min read@wire line in your component and the moment contacts.data has a value. It assumes you can write a cacheable Apex method and import it into a component, and that you know @api properties and JavaScript destructuring. The wire syntax is covered in t7 min read@AuraEnabled(cacheable=true) already imported into your JavaScript file, as covered in the earlier chapters. You should also be comfortable with @api properties and template conditionals. Here you wil5 min read@api properties. It also assumes you know basic Apex and SOQL, and that you have already wired an Apex method to a property. Here you learn how to make a wire re-run when a value in yo7 min readdata and error, and the template reads it directly. That is enough when you display the server result unchanged. Wiring to a function lets you run your own code each time the wire provisions a value. You can reshape the rows, set several fields at on6 min readdata and error from it, and use reactive parameters. Here you will learn what a wire error looks like, how to throw useful errors from Apex, how to turn any error into text, and how to show it in a template.5 min read@AuraEnabled(cacheable=true) Apex methods. It covers why a wired component can show data that is out of date, and how to work with that behavior. It assumes you have read the earlier chapters on exposing an Apex method, i6 min readcacheable=true methods are cached on the client, and that wire results arrive as an object with data and error. Here you will learn how to make a wire fetch fresh data when nothing a5 min read@AuraEnabled method, import it into a component, and wire it to a property or function. Here you will learn when a wire is the wrong tool and how to call the same Apex method imperatively.5 min read@AuraEnabled method, import it, and w5 min read@salesforce/sfdx-lwc-jest and test the ContactList component from earlier in the tut5 min read