Skip to content

Instantly share code, notes, and snippets.

@mfrachet
Created January 11, 2019 13:16
Show Gist options
  • Select an option

  • Save mfrachet/550b68a8dc96f0e2f55012079e6ca588 to your computer and use it in GitHub Desktop.

Select an option

Save mfrachet/550b68a8dc96f0e2f55012079e6ca588 to your computer and use it in GitHub Desktop.
react-cache-fetchwithcache
let cache;
export const customFetch = url => /* we already implemented this */
export const fetchWithCache = url =>
window
.fetch(url)
.then(res => res.json())
.then(data => {
cache = data;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment