In the code below I typed the dispatch function as "any". I am doing this to clear the error I get if I don't type it.
What is the correct way to type it with Typescript ?
export function doThing() {
console.log("works")
return (dispatch:any) => { // any ?
fetch('https://whatever.com/some-api').then((response) => {
return response.json()
}).then((data) => {
dispatch(pingApiAction(data))
})
};
}