ready-xet-go / js /app.js
jsulz's picture
jsulz HF Staff
refactor - needs some more tlc
f0bb158
raw
history blame contribute delete
897 Bytes
import { DataFetcher } from './data-fetcher.js';
import { ProgressBar } from './progress-bar.js';
import { ChartManager } from './chart-manager.js';
import { PixelCounter } from './pixel-counter.js';
class App {
constructor() {
this.dataFetcher = new DataFetcher();
this.progressBar = new ProgressBar('progressBar');
this.chartManager = new ChartManager();
this.pixelCounter = new PixelCounter();
}
async init() {
try {
const data = await this.dataFetcher.fetchAllData();
this.progressBar.init(data.repoData);
this.chartManager.init(data.repoData, data.fileData);
this.pixelCounter.init(data.bytesData);
} catch (error) {
console.error('Failed to initialize app:', error);
}
}
}
(async () => {
const app = new App();
await app.init();
})();