by noir_lord · 8y ago · 0 comments
It makes for nice code.
Promise<JSendApiResponse>
With the benefit of HTTP level stuff not been mapped onto application level stuff.I like KISS with this kind of thing and if you need a more complex solution it handles that as a starting point.
interface IResponse {
foo: string
}
async function doSomething() {
const reponse: AxiosResponse<IResponse> = await Api.call()
...
// or you can use AxiosPromise<IResponse> without the await
}