Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function loadJS(src) {
if (!PROMISES[src]) PROMISES[src] = script(src);
return PROMISES[src];
}
export function loadD3() {
const load1 = script('/resources/shared/vendor/d3.v4.min.js');
const load2 = script('/resources/shared/vendor/d3-geo-projection.v2.min.js');
const load3 = script('/resources/shared/vendor/topojson.v1.min.js');
return Promise.all([load1, load2, load3])
.then(() => fetch('/resources/circles/images/world-110m.json'))
.then(text => text.json())
.then(world => ({d3, topojson, world}));
}
export function loadD3() {
const load1 = script('/resources/shared/vendor/d3.v4.min.js');
const load2 = script('/resources/shared/vendor/d3-geo-projection.v2.min.js');
const load3 = script('/resources/shared/vendor/topojson.v1.min.js');
return Promise.all([load1, load2, load3])
.then(() => fetch('/resources/circles/images/world-110m.json'))
.then(text => text.json())
.then(world => ({d3, topojson, world}));
}
export function loadD3() {
const load1 = script('/resources/shared/vendor/d3.v4.min.js');
const load2 = script('/resources/shared/vendor/d3-geo-projection.v2.min.js');
const load3 = script('/resources/shared/vendor/topojson.v1.min.js');
return Promise.all([load1, load2, load3])
.then(() => fetch('/resources/circles/images/world-110m.json'))
.then(text => text.json())
.then(world => ({d3, topojson, world}));
}