diff --git a/src/collections.js b/src/collections.js index a137905..0758c79 100644 --- a/src/collections.js +++ b/src/collections.js @@ -55,7 +55,7 @@ class Collections { * * @private */ - _findCollecitons(repo) { + _findCollections(repo) { return new Promise((fulfill, reject) => { let config = this._config, dirs = config._dirs, @@ -99,19 +99,19 @@ class Collections { } /** - * Find all collections and load + * Find all collections and loadQueue * * @returns {Promise} */ reload() { return new Promise((fulfill, reject) => { let promises = [ - this._findCollecitons('simple-svg'), - this._findCollecitons('custom') + this._findCollections('simple-svg'), + this._findCollections('custom') ]; Promise.all(promises).then(() => { - return this.load(); + return this.loadQueue(); }).then(() => { fulfill(this); }).catch(err => { @@ -128,8 +128,8 @@ class Collections { */ loadRepo(repo) { return new Promise((fulfill, reject) => { - Promise.all(this._findCollecitons(repo)).then(() => { - return this.load(); + Promise.all(this._findCollections(repo)).then(() => { + return this.loadQueue(); }).then(() => { fulfill(this); }).catch(err => { @@ -163,7 +163,7 @@ class Collections { * * @returns {Promise} */ - load() { + loadQueue() { return new Promise((fulfill, reject) => { let promises = []; @@ -246,7 +246,7 @@ class Collections { collection.loadFile(filename).then(() => { if (!collection.loaded) { if (this._log !== null) { - this._log('Failed to load collection: ' + filename); + this._log('Failed to loadQueue collection: ' + filename); } fulfill(false); return; diff --git a/src/sync.js b/src/sync.js index 4391e2c..7982093 100644 --- a/src/sync.js +++ b/src/sync.js @@ -307,7 +307,7 @@ const functions = { console.log('Cleaning up old repositories...'); - // Delete all directories, but only 1 at a time to reduce load + // Delete all directories, but only 1 at a time to reduce loadQueue promiseQueue(dirs, dir => removeDir(dir)).then(() => { cleaning = false; }).catch(err => { diff --git a/tests/collection_test.js b/tests/collection_test.js index f380c0d..4887b0b 100644 --- a/tests/collection_test.js +++ b/tests/collection_test.js @@ -32,7 +32,7 @@ }; let collection = new Collection(); - collection.loadJSON(data); // load as object + collection.loadJSON(data); // loadQueue as object expect(collection.loaded).to.be.equal(true); expect(collection.prefix).to.be.equal('foo'); @@ -62,7 +62,7 @@ }; let collection = new Collection('foo'); - collection.loadJSON(JSON.stringify(data)); // load as string + collection.loadJSON(JSON.stringify(data)); // loadQueue as string expect(collection.loaded).to.be.equal(true); expect(collection.prefix).to.be.equal('foo');