Skip to content

Commit

Permalink
correctly use Promise.resolve()
Browse files Browse the repository at this point in the history
  • Loading branch information
dpraul committed Sep 12, 2019
1 parent fff81d5 commit 88f5665
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/js/geomap.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,14 @@ export class Geomap {
self.update();
};

Promise.resolve(() => {
if (self.properties.geoData) {
return self.properties.geoData;
}
return d3JSONFetch(self.properties.geofile);
}).then(geo => drawGeoData(geo));
Promise.resolve()
.then(() => {
if (self.properties.geoData) {
return self.properties.geoData;
}
return d3JSONFetch(self.properties.geofile);
})
.then(geo => drawGeoData(geo));
}

update() {
Expand Down

0 comments on commit 88f5665

Please sign in to comment.