Skip to content

Instantly share code, notes, and snippets.

@julianburr
Last active January 29, 2019 09:37
Show Gist options
  • Save julianburr/a44049f5111790f44814c91bdce97e9c to your computer and use it in GitHub Desktop.
Save julianburr/a44049f5111790f44814c91bdce97e9c to your computer and use it in GitHub Desktop.
Why Suspense Will Be a Game Changer - Suspense
import createResource from './magical-cache-provider';
const dataResource = createResource((id) => fetchData(id));
class DynamicData extends Component {
render () {
const data = dataResource.read(this.props.id);
return <p>Data loaded 🎉</p>;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment