Skip to content
This repository has been archived by the owner on Feb 13, 2019. It is now read-only.

Commit

Permalink
pull origin/master
Browse files Browse the repository at this point in the history
  • Loading branch information
camsom committed Aug 30, 2016
2 parents 0ac7887 + b60e613 commit e59efaf
Showing 1 changed file with 16 additions and 6 deletions.
@@ -1,14 +1,24 @@
module.exports = (function () { // eslint-disable-line no-unused-vars
var _ = require('lodash');
var assign = _.assign;
var defaults = _.defaults;
var isUndefined = _.isUndefined;
var trim = _.trim;
function isUndefined (suspect) {
return typeof(suspect) === 'undefined';
}

function requireArgument (value, message) {
if (isUndefined(value)) { throw new Error(message); }
}

function assign (target, source) {
Object.keys(source).forEach(function (key) {
target[key] = source[key];
});
}

function defaults (target, source) {
Object.keys(source).forEach(function (key) {
if (!target[key]) { target[key] = source[key]; }
});
}

function SpecialCoverageLoader (element, listElement, options) {
requireArgument(element, 'new SpecialCoverageLoader(element, listElement, options): element is undefined');
requireArgument(listElement, 'new SpecialCoverageLoader(element, listElement, options): listElement is undefined');
Expand Down Expand Up @@ -79,7 +89,7 @@ module.exports = (function () { // eslint-disable-line no-unused-vars
handleLoadMoreSuccess: function (response) {
this.toggleLoadingState(this.isLoading, this.element);
requireArgument(response, 'SpecialCoverageLoader.handleLoadMoreSuccess(response): response is undefined');
response = trim(response);
response = response.trim();
if (response) {
this.currentPage += 1;
this.listElement.innerHTML = this.listElement.innerHTML + response;
Expand Down

0 comments on commit e59efaf

Please sign in to comment.