Skip to content
Snippets Groups Projects
Commit 2ae89d7b authored by yamadapc's avatar yamadapc
Browse files

Cache setup promise

parent 84844650
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
No preview for this file type
This diff is collapsed.
......@@ -158,6 +158,8 @@ var Steem = function (_EventEmitter) {
value: function getApiIds() {
var _this3 = this;
if (this.apiIdsP) return this.apiIdsP;
this.apiIdsP = _bluebird2.default.map(Object.keys(this.apiIds), function (name) {
debugSetup('Syncing API IDs', name);
return _this3.getApiByNameAsync(name).then(function (result) {
......
......@@ -115,6 +115,8 @@ class Steem extends EventEmitter {
}
getApiIds() {
if (this.apiIdsP) return this.apiIdsP;
this.apiIdsP = Promise.map(Object.keys(this.apiIds), (name) => {
debugSetup('Syncing API IDs', name);
return this.getApiByNameAsync(name).then((result) => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment