I’ve tried
const instance = axios.create();
instance.interceptors.request.use((cfg) => {
InteractionManager.runAfterInteractions(() => {
const token = getToken();
if (token) {
cfg.headers.Authorization = `${token.scheme} ${token.value}`;
}
return cfg;
});
});
Which of course axios isn’t happy, it’s not returning anything. Any way to do runAfterInteractions
synchronously?
Or any ideas other wrapping each api calls manually (there’s a lot of them)?