0
votes

How to pass List data type from LWC @wire method to Custom Aura Method

2
To Apex or to another Aura controller? Your question is unclear. What have you tried so far, post some code.eyescream

2 Answers

0
votes

You can do it by making an array of required datatype:

If your data type is of primitive type than push that directly into the array, or

If your data type is an object or subject, create a javascript object by making use of {}, add the key values corresponding to the object structure, and push the same in the array.

At last, leverage the same array to pass it to the apex controller method.

0
votes

Let say you have an Apex class as below

@AuraEnabled(cacheable=true)
public static Object processResponse(string recordId) { }

Below is the example wire statement to call the above method and passing the recordId.

@wire(processResponse, { recordId: '123123123' })
contact;