Async helper on property on the data object

Hi,
I don’t know if this is going to come back and bite me. But I was frustrated with the need to set property on data in a lifehook-function when it is an async call.

I have a repository where I have async functions with GraphQL-queryies.
This is the helper function:

const asyncHelper = function(f,vm,prop) {
    setTimeout(async function() {
        let result = await f()

        if(typeof vm === 'undefined' || typeof prop === 'undefined') return {}
        
        if(typeof result === "string" || typeof result === "number") {
            vm[prop] = result
        } else {
            vm[prop] = Object.assign({},vm[prop],result)
        }
    },0)
    return {}
}

Then on a dataproperty:

  myGame: asyncHelper(() => Matchimport.Get(),this,"myGame")

It is a little bit verbose, and maybe this can come back and bite me? Who knows?
But it works, at least the cases I tried…