react-native-in-app-debugger 1.0.35 → 1.0.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -75,6 +75,7 @@ All FlatList props should work plus props mentioned below
75
75
  | `labels` | Array of strings | Array of strings you want to show of the floating debugger pill. For each strings in the array will eb displayed as a single line in the floating debugger pill | | Optional |
76
76
  | `maxNumOfApiToStore` | integer | Number of APIs to be kept. Too much API might make the whole app lag, therefore need to trade off. Suggested value is 50 | | Optional. If not set, all APIs will be kept forever |
77
77
  `version` | string | Any string passed here will be shown in debugger's floating panel. | | Optional. If not supplied, version number will taken automatically using React Native Device Info library. But if Device Info library is not installed, then no version will be shown if this prop is not passed.
78
+ `interceptResponse` | function | Callback function when receive response from any API. | | Optional
78
79
 
79
80
 
80
81
  ### Integration with Third Party Library
package/index.jsx CHANGED
@@ -48,8 +48,9 @@ export default ({
48
48
  version = v,
49
49
  maxNumOfApiToStore = 0,
50
50
  labels = [],
51
+ interceptResponse
51
52
  }) => {
52
- const { apis, clear } = useApiInterceptor(maxNumOfApiToStore);
53
+ const { apis, clear } = useApiInterceptor(maxNumOfApiToStore, interceptResponse);
53
54
 
54
55
  const [tab, setTab] = useState("api");
55
56
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-in-app-debugger",
3
- "version": "1.0.35",
3
+ "version": "1.0.36",
4
4
  "description": "This library's main usage is to be used by Non-Technical testers during UAT, SIT or any testing phase.",
5
5
  "main": "index.jsx",
6
6
  "scripts": {
@@ -17,7 +17,7 @@ const parse = (data) => {
17
17
  }
18
18
  };
19
19
 
20
- export default (maxNumOfApiToStore) => {
20
+ export default (maxNumOfApiToStore, interceptResponse) => {
21
21
  const [apis, setApis] = useState([]);
22
22
 
23
23
  const makeRequest = (data) => {
@@ -93,6 +93,7 @@ export default (maxNumOfApiToStore) => {
93
93
  });
94
94
 
95
95
  XHRInterceptor.setResponseCallback((...obj) => {
96
+ interceptResponse?.(...obj);
96
97
  const { _method: method, _url: url, _response, status } = obj[5];
97
98
  if (filterNonBusinessRelatedAPI) {
98
99
  if (shouldExclude(url, method)) return;