Last active
December 2, 2018 13:33
-
-
Save smks/7a86e9c5ffcf27a17a8e7594efb3adab to your computer and use it in GitHub Desktop.
API to get people service
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 axios from 'axios'; | |
const GET_PEOPLE_ENDPOINT = `https://jsonplaceholder.typicode.com/users`; | |
class API { | |
constructor(api) { | |
this.api = api; | |
} | |
getPeople = () => { | |
return this.api.get(GET_PEOPLE_ENDPOINT); | |
}; | |
} | |
export default new API(axios); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment