{"action":"opened","issue":{"url":"https://api.github.com/repos/kuitos/axios-extensions/issues/36","repository_url":"https://api.github.com/repos/kuitos/axios-extensions","labels_url":"https://api.github.com/repos/kuitos/axios-extensions/issues/36/labels{/name}","comments_url":"https://api.github.com/repos/kuitos/axios-extensions/issues/36/comments","events_url":"https://api.github.com/repos/kuitos/axios-extensions/issues/36/events","html_url":"https://github.com/kuitos/axios-extensions/issues/36","id":373477168,"node_id":"MDU6SXNzdWUzNzM0NzcxNjg=","number":36,"title":"cacheFlag not working in react native","user":{"login":"techgig17","id":28253737,"node_id":"MDQ6VXNlcjI4MjUzNzM3","avatar_url":"https://avatars3.githubusercontent.com/u/28253737?v=4","gravatar_id":"","url":"https://api.github.com/users/techgig17","html_url":"https://github.com/techgig17","followers_url":"https://api.github.com/users/techgig17/followers","following_url":"https://api.github.com/users/techgig17/following{/other_user}","gists_url":"https://api.github.com/users/techgig17/gists{/gist_id}","starred_url":"https://api.github.com/users/techgig17/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/techgig17/subscriptions","organizations_url":"https://api.github.com/users/techgig17/orgs","repos_url":"https://api.github.com/users/techgig17/repos","events_url":"https://api.github.com/users/techgig17/events{/privacy}","received_events_url":"https://api.github.com/users/techgig17/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-24T13:15:32Z","updated_at":"2018-10-24T13:15:32Z","closed_at":null,"author_association":"NONE","body":"When I use CacheFlag to control caching, CacheFlag is not working in react native as expected\r\n\r\nMy code is as below\r\n\r\nconst axiosClient = axios.create({\r\n    baseURL: HOST,\r\n    headers: {\r\n        'Content-type': 'application/json',\r\n        'Cache-Control': 'no-cache'\r\n    },\r\n\tadapter: cacheAdapterEnhancer(axios.defaults.adapter, { enabledByDefault: false, cacheFlag: 'useCache'})\r\n});\r\n\r\nthen in a function\r\nreturn await axiosClient.get(URL, params, {useCache : true});\r\n\r\nIf i change in cacheAdapterEnhancer.js\r\n\r\nvar useCache = (config[cacheFlag] !== void 0 && config[cacheFlag] !== null) ? config[cacheFlag] : enabledByDefault;\r\n\r\nto\r\n\r\nvar useCache = (cacheFlag !== void 0 && cacheFlag !== null) ? cacheFlag : enabledByDefault;\r\n\r\nNow the flag works as expected. Kindly help with the issue"}}
{"actor":{"display_login":"techgig17"}}