Created
October 16, 2018 23:40
-
-
Save evonsdesigns/203fac68014335880ef9541617df0c08 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 xhr from 'xhr'; | |
const AVKEY = 'N77G40733L3SU8Z3'; | |
const BASE_URL = 'https://www.alphavantage.co/query?function=SECTOR&apikey='; | |
export function getSectorsPerformance() { | |
return new Promise((resolve, reject) => { | |
xhr.get(BASE_URL + AVKEY, (err, resp, body) => { | |
if(err) { | |
reject(err); | |
} | |
resolve(JSON.parse(body)); | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment