Let's assume we have plain object
const foo = {}
and by using Promise constructor syntax we would add async method to it this way:
foo.myAsyncMethod = function () {
return new Promise((resolve, reject) => {
...
})
}
but we can't do this (according to ESlint):
foo.myAsyncMethod = async function() {
...
}
what is convenient approach to add new async functions to objects as method properties after object is already declared?