I have a bigger decorator, but just made a toy example of where my issue is.
I'm trying to update the result from inside a decorator, but it's giving me undefined. How can I do this?
let decorator = async (dummy, method) => {
console.log(dummy)
await method()
}
let dummy = 'dummy'
let result
decorator(dummy, async ()=> {
result = await queryDatabase(queryParams)
})
console.log(result) // prints undefined
UPDATE
I realised I should just await the decorator. Now it's working.