Last active
March 15, 2018 19:41
-
-
Save CharlesMangwa/cb8ce78d16073c012a94b42d821fa608 to your computer and use it in GitHub Desktop.
React Data Fetching - `<ConnectedFetch>` use case
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import { Provider } from 'react-redux' | |
import { ConnectedFetch } from 'react-data-fetching' | |
import App from './app' | |
const Root = () => ( | |
<Provider store={store}> | |
<ConnectedFetch | |
api="htpps://api.nyan.com" | |
headers={{ | |
'X-Nyan-Token': 'superNyan', | |
}} | |
loader={<p>♻️ Loading…</p>} | |
timeout={5000} | |
> | |
<App /> | |
</ConnectedFetch> | |
</Provider> | |
) | |
export default Root |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment