I am trying to fetch full history of all charts and call your great function repeatedly (and more important synchronously) with shifted date:
const date = new Date('2016-11-19');
// loop
const formattedDate = format('yyyy-MM-dd', date);
billboard (formattedDate,....)
date.setDate(date.getDate() - 7);
// end of loop
And everything works great but sometimes there is no chart for the given date for some reason. For now billboard function just silently finishes. It would be great to emit some exception or error callback. There is no info that this date should be skipped and it is ok to try to fetch data for the next week.
I am trying to fetch full history of all charts and call your great function repeatedly (and more important synchronously) with shifted date:
const date = new Date('2016-11-19'); // loop const formattedDate = format('yyyy-MM-dd', date); billboard (formattedDate,....) date.setDate(date.getDate() - 7); // end of loop
And everything works great but sometimes there is no chart for the given date for some reason. For now billboard function just silently finishes. It would be great to emit some exception or error callback. There is no info that this date should be skipped and it is ok to try to fetch data for the next week.