-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Oil 292/load vendor list refactoring #215
Conversation
Pull Request Test Coverage Report for Build 800
💛 - Coveralls |
}); | ||
if (pendingVendorlistPromise) { | ||
return pendingVendorlistPromise; | ||
} else if (cachedVendorList) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the unlikely case that pendingVendorlistPromise AND cachedVendorList exist I would prefer to check for cachedVendorList first.
return pendingVendorlistPromise; | ||
} else if (cachedVendorList) { | ||
return new Promise(function (resolve) { | ||
resolve(cachedVendorList); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use consistent function definition. Line 19 and 23 use "function() {}", line 26 use an arrow function.
let iabVendorListUrl = getIabVendorListUrl(); | ||
pendingVendorlistPromise = fetchJsonData(iabVendorListUrl) | ||
pendingVendorlistPromise.then(response => { | ||
cachedVendorList = response; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cachedVendorList should be assigned only if it's ready. Therefore, order should be: 1. sort - 2. assign. Otherwise, it would be possible that an unsorted vendor list is returned.
No description provided.