{"action":"created","issue":{"url":"https://api.github.com/repos/heroku/react-refetch/issues/75","repository_url":"https://api.github.com/repos/heroku/react-refetch","labels_url":"https://api.github.com/repos/heroku/react-refetch/issues/75/labels{/name}","comments_url":"https://api.github.com/repos/heroku/react-refetch/issues/75/comments","events_url":"https://api.github.com/repos/heroku/react-refetch/issues/75/events","html_url":"https://github.com/heroku/react-refetch/issues/75","id":138044802,"number":75,"title":"Supply custom fetch() implementation","user":{"login":"passcod","id":155787,"avatar_url":"https://avatars.githubusercontent.com/u/155787?v=3","gravatar_id":"","url":"https://api.github.com/users/passcod","html_url":"https://github.com/passcod","followers_url":"https://api.github.com/users/passcod/followers","following_url":"https://api.github.com/users/passcod/following{/other_user}","gists_url":"https://api.github.com/users/passcod/gists{/gist_id}","starred_url":"https://api.github.com/users/passcod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/passcod/subscriptions","organizations_url":"https://api.github.com/users/passcod/orgs","repos_url":"https://api.github.com/users/passcod/repos","events_url":"https://api.github.com/users/passcod/events{/privacy}","received_events_url":"https://api.github.com/users/passcod/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-03T01:20:08Z","updated_at":"2016-03-03T13:35:42Z","closed_at":null,"body":"It would be great if a custom `fetch()` implementation could be supplied to React Refetch. My usecase would be not using a completely custom implementation (although I think that could be useful, too), but doing something like this:\r\n\r\n```js\r\nfunction customFetch (input, init = {}) {\r\n  init.credentials = 'include'\r\n  // do something on the input, too\r\n  return window.fetch(input, init)\r\n  .then(response => preprocess(response))\r\n}\r\n```\r\n\r\nAs well as implementing a kind of caching proxy that maintains a cache of responses and provides them directly from memory if Refetch asks for them based on some conditions (say, time since last request for that url, or `window.onLine === false`, or the heartbeat signal we use to check for _effective offlineness_, etc)."},"comment":{"url":"https://api.github.com/repos/heroku/react-refetch/issues/comments/191763066","html_url":"https://github.com/heroku/react-refetch/issues/75#issuecomment-191763066","issue_url":"https://api.github.com/repos/heroku/react-refetch/issues/75","id":191763066,"user":{"login":"passcod","id":155787,"avatar_url":"https://avatars.githubusercontent.com/u/155787?v=3","gravatar_id":"","url":"https://api.github.com/users/passcod","html_url":"https://github.com/passcod","followers_url":"https://api.github.com/users/passcod/followers","following_url":"https://api.github.com/users/passcod/following{/other_user}","gists_url":"https://api.github.com/users/passcod/gists{/gist_id}","starred_url":"https://api.github.com/users/passcod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/passcod/subscriptions","organizations_url":"https://api.github.com/users/passcod/orgs","repos_url":"https://api.github.com/users/passcod/repos","events_url":"https://api.github.com/users/passcod/events{/privacy}","received_events_url":"https://api.github.com/users/passcod/received_events","type":"User","site_admin":false},"created_at":"2016-03-03T13:35:42Z","updated_at":"2016-03-03T13:35:42Z","body":"That's interesting, but not much more than my code block above. It acts globally, so it doesn't provide the ability to set interceptors or modifiers or proxies or whatnot _on a per-`connect` basis_, which is really what I wish for."}}