Skip to content

Instantly share code, notes, and snippets.

@evonsdesigns
Created October 16, 2018 23:40
Show Gist options
  • Save evonsdesigns/203fac68014335880ef9541617df0c08 to your computer and use it in GitHub Desktop.
Save evonsdesigns/203fac68014335880ef9541617df0c08 to your computer and use it in GitHub Desktop.
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