Skip to content

Instantly share code, notes, and snippets.

@ryanflorence
Created October 5, 2018 16:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanflorence/30549ac268ee1b2e3feeb49cee933420 to your computer and use it in GitHub Desktop.
Save ryanflorence/30549ac268ee1b2e3feeb49cee933420 to your computer and use it in GitHub Desktop.
import { createResource } from 'react-cache'
let InvoiceResource = createResource(
(id) => {
return fetch(`/invoices/${id}`).then(response => {
return response.json()
})
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment