My functionA has a singature Promise<(dispatch:ThunkDispatch, getState() => StoreState) => Promise<boolean>>.
I try to extract the value that this function returns like this:
async function getValue() {
const promise = dispatch(functionA(args));
const value = await promise;
return value;
}
But if I try to return this function into a value lets say variable returnedValue. The console.log of the variable will say either true or false. But I won't be able to use the variable in a statement. Because I get this error message
Type 'Promise<(dispatch: ThunkDispatch, getState: () => StoreState) => Promise<boolean>>' is not assignable to type 'boolean'
How can I correct this error message? What am I doing wrong?