TP-84996 | Caching in RN (#13461)
This commit is contained in:
@@ -1,4 +1,9 @@
|
||||
import axios, { AxiosRequestConfig, AxiosResponse } from "axios";
|
||||
import {
|
||||
AnalyticsEventNameConstants,
|
||||
NETWORK_ERROR,
|
||||
} from "../App/common/constants";
|
||||
import { sendAsAnalyticsEvent } from "../App/common/hooks/useAnalyticsEvent";
|
||||
import { NetworkConnectorModule } from "../App/common/native-module/NativeModules";
|
||||
import { BASE_URL } from "./NetworkConstant";
|
||||
|
||||
@@ -7,7 +12,12 @@ export const getDefaultHeaderData = async () => {
|
||||
const data = await NetworkConnectorModule.getAllNativeHeaders();
|
||||
return data;
|
||||
} catch (error) {
|
||||
console.error("Error fetching data:", error);
|
||||
sendAsAnalyticsEvent({
|
||||
name: AnalyticsEventNameConstants.HI_RN_FETCH_NATIVE_HEADER_ERROR,
|
||||
properties: {
|
||||
reason: error?.toString() || NETWORK_ERROR,
|
||||
},
|
||||
});
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user