Salesforce Decode
Salesforcedecode
Back to questions
LWCBeginnerwireadapters

What is @wire in LWC?

Real World Scenario

You load picklist values for an object field without Apex. You explain wire adapters.

Expected Answer

• @wire decorates a property or function to call a Lightning adapter reactively • Adapters include getRecord, getObjectInfo, getPicklistValues, and Apex methods marked cacheable • Wire re-runs when reactive parameters change, like recordId • Destructure error and data in template or property for loading states • Cacheable=true Apex used with wire must not perform DML

Follow-Up Questions & Answers

Click to expand — each follow-up includes a direct, interview-ready answer

Wire is declarative and cached; imperative callApexMethod runs when you invoke it in code—better after user clicks Save.

Architect Perspective

Wire = read reactive; imperative = write/action. That one line clears many wire questions.