As I delve into the world of Vue + Vuex, I find myself grappling with the challenge of initializing an API that relies on asynchronous methods.
The common solutions I've attempted so far have hit roadblocks - can't use await
outside an async function and exporting a promise doesn't sit well with Vue.
I aim to leverage the 'handle' component within my actions for handling async requests, but this is contingent upon the resolution of 'handle' itself.
I'm struggling to determine the optimal placement for this initialization process. One option is to initialize 'handle' globally before starting the Vue app, but this spatial separation from its usage feels awkward. Are there established approaches for tackling such scenarios?
Your insights would be immensely valuable!