Skip to content
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

Merged
merged 3 commits into from
Oct 9, 2018

Conversation

TimonBerlin
Copy link
Contributor

No description provided.

@coveralls
Copy link

coveralls commented Oct 5, 2018

Pull Request Test Coverage Report for Build 800

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 27 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.005%) to 26.638%

Files with Coverage Reduction New Missed Lines %
dist/oil.bundle.js 27 26.64%
Totals Coverage Status
Change from base Build 796: -0.005%
Covered Lines: 1104
Relevant Lines: 3368

💛 - Coveralls

});
if (pendingVendorlistPromise) {
return pendingVendorlistPromise;
} else if (cachedVendorList) {
Copy link
Contributor

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);
Copy link
Contributor

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;
Copy link
Contributor

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.

@TimonBerlin TimonBerlin merged commit 05e2dcb into master Oct 9, 2018
@TimonBerlin TimonBerlin deleted the OIL-292/loadVendorListRefactoring branch October 9, 2018 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants