Answer the question
In order to leave comments, you need to log in
How to initialize object property with async function?
let data = new function(){
(async ()=> {
return new Promise(resolve => {
ipcRenderer.send('message', 'ping');
ipcRenderer.on('reply', (event, arg) => {
resolve(arg);
})
})
});
}
let obj = {
data: data
}
console.log(obj)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question