refactoring
This commit is contained in:
@@ -12,13 +12,10 @@ class SymptomVsSymptomChartView {
|
|||||||
if (this.#chart != null) {
|
if (this.#chart != null) {
|
||||||
this.#chart.destroy();
|
this.#chart.destroy();
|
||||||
}
|
}
|
||||||
// FK-TODO: fetch multiple files: https://stackoverflow.com/a/31711496 or https://stackoverflow.com/a/53892713
|
// FK-TODO: move PrrByVaccineProvider.getPrrByVaccine() calls out of this function
|
||||||
PrrByVaccineProvider.getPrrByVaccine(symptomX)
|
Promise
|
||||||
.then(
|
.all([symptomX, symptomY].map(symptom => PrrByVaccineProvider.getPrrByVaccine(symptom)))
|
||||||
prrByLotX => {
|
.then(([prrByLotX, prrByLotY]) => {
|
||||||
PrrByVaccineProvider.getPrrByVaccine(symptomY)
|
|
||||||
.then(
|
|
||||||
prrByLotY => {
|
|
||||||
const chartData = SymptomVsSymptomChartDataProvider.getChartData({ prrByLotX, prrByLotY });
|
const chartData = SymptomVsSymptomChartDataProvider.getChartData({ prrByLotX, prrByLotY });
|
||||||
const data = {
|
const data = {
|
||||||
datasets: [{
|
datasets: [{
|
||||||
@@ -61,7 +58,6 @@ class SymptomVsSymptomChartView {
|
|||||||
// }
|
// }
|
||||||
config);
|
config);
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setData(histoDescr) {
|
setData(histoDescr) {
|
||||||
|
|||||||
Reference in New Issue
Block a user