mapbox-gl
Version:
A WebGL interactive maps library
18 lines (14 loc) • 363 B
JavaScript
// @flow
import WorkerPool from './worker_pool';
let globalWorkerPool;
/**
* Creates (if necessary) and returns the single, global WorkerPool instance
* to be shared across each Map
* @private
*/
export default function getGlobalWorkerPool () {
if (!globalWorkerPool) {
globalWorkerPool = new WorkerPool();
}
return globalWorkerPool;
}