You need to sign in to do that
Don't have an account?
Anshuma Yadav
How to write imperative wire inside the connectedCallback event in JavaScript using LWC component?
I am writing the below code for the same but it's not working.
connectedCallback(){
const messageCallback = (response) => {
console.log('New message received3 : ', JSON.stringify(response));
getRecordList({recordId : this.recordId})
.then(result => {
this.wrapperList2 = result;
console.log('result1 ',JSON.stringify(this.wrapperList2));
})
.catch(error => {
console.log('Errorured2:- '+error.body.message);
});
}
console.log('Inside connected callback4');
subscribe(this.channelName, -1, messageCallback)
.then(response =>
{
console.log('****Subscription request fulfilled****5 ', JSON.stringify(response.channel));
})
}
Thankyou!!
connectedCallback(){
const messageCallback = (response) => {
console.log('New message received3 : ', JSON.stringify(response));
getRecordList({recordId : this.recordId})
.then(result => {
this.wrapperList2 = result;
console.log('result1 ',JSON.stringify(this.wrapperList2));
})
.catch(error => {
console.log('Errorured2:- '+error.body.message);
});
}
console.log('Inside connected callback4');
subscribe(this.channelName, -1, messageCallback)
.then(response =>
{
console.log('****Subscription request fulfilled****5 ', JSON.stringify(response.channel));
})
}
Thankyou!!