refactoring
This commit is contained in:
11
docs/HistoDescrsProvider.js
Normal file
11
docs/HistoDescrsProvider.js
Normal file
@@ -0,0 +1,11 @@
|
||||
class HistoDescrsProvider {
|
||||
|
||||
static getHistoDescrsForBatchcode(batchcode) {
|
||||
return fetch(`data/histograms/${batchcode}.json`)
|
||||
.then(response => response.json())
|
||||
.then(histoDescrs => {
|
||||
histoDescrs.histograms.sort((histoDescr1, histoDescr2) => histoDescr1.batchcodes.length - histoDescr2.batchcodes.length);
|
||||
return histoDescrs;
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user