Apisauce interceptor
Advertisements Recently i had to rewrite all of my API calls with Apisauce, is amazing but i have very repeating code which looks like this: const response: ApiResponse<{ result: ReponseType }> = await api.post(‘endpoint1’, reqBody); if (!response.ok || !response.data) { return getGeneralApiProblem(response); } return { kind: ‘ok’, userInfo: response.data.result }; const response: ApiResponse<{ result: ReponseType… Read More Apisauce interceptor