Created
May 12, 2020 10:56
-
-
Save fernandocamargo/dfa1b6ef8249a4d43337df8ad58b38f8 to your computer and use it in GitHub Desktop.
This file contains 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 axios from 'axios'; | |
export default axios.create({ | |
baseURL: 'https://api.expertlead.de/v.1.0/', | |
timeout: 1000, | |
headers: { | |
'token': '<YOUR_TOKEN>' | |
} | |
}); |
This file contains 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 useService from 'service'; | |
export default () => { | |
const [fetch] = useService(); | |
return ( | |
<div> | |
<button onClick={fetch}>Fetch data</button> | |
</div> | |
); | |
}; |
This file contains 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 client from 'client'; | |
export default () => client.get('/some-endpoint'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment