Recently, I came across a Typescript project in Vue.js with a Vuex store that had the following code:
async getUserProfile ({ dispatch, commit }: any) {}
I found working with any
cumbersome as it doesn't provide helpful autocomplete features in the editor. After some research, I discovered this solution:
import { Dispatch, Commit } from "vuex";
. My question now is how can I integrate this information into { dispatch, commit }: any
?