I have some code similar to the following :
nodeEnter.append('text')
.text(async function(d) {
var count = await dispatch('GetCount', {
chosenNode: d
});
return count || 'N/A';
});
When running this, the text that shows looks like this :
[object Promise]
The function works but obviously returns before the promise returns anything. How would I go about awaiting an action in code similar to the above ?
I am using Vuex with VueJs, that's what the dispatch is working with.