Organiser les appels API React Native Dossier
import ky from "ky";
const apiClient = ky.create({
prefixUrl: API_URL, // <- ENV variable
headers: {
...
}
hooks: {
beforeRequest: (request) => {...}
afterResponse: (response) => {...}
});
const { get, post, put, delete: destroy } = apiClient;
export { get, post, put, destroy };
Outrageous Ocelot