UNPKG

@giro3d/giro3d

Version:

A JS/WebGL framework for 3D geospatial data visualization

19 lines (18 loc) 511 B
import OperationCounter from '../../core/OperationCounter'; import Fetcher from '../../utils/Fetcher'; /** * A plugin that routes HTTP calls to the Giro3D Fetcher. */ export default class FetchPlugin { _opCounter = new OperationCounter(); get loading() { return this._opCounter.loading; } get progress() { return this._opCounter.progress; } fetchData(url, options) { this._opCounter.increment(); return Fetcher.fetch(url, options).finally(() => this._opCounter.decrement()); } }