complete = function complete(nodes, totalNodes) {
            // A little type-safety for silly situations
            if (!isArrayLike(nodes)) {
              return reject(new TypeError('Loader requires an array-like `nodes` parameter.'));
            }

            // Delay event for synchronous loader. Otherwise it fires
            // before the user has a chance to listen.
            if (!_this3.initialized && isArrayLike(nodes)) {
              setTimeout(function () {
                _this3.emit('data.loaded', nodes);
              });
            } else {
              _this3.emit('data.loaded', nodes);
            }

            // Parse newly-loaded nodes
            var newModel = collectionToModel(_this3, nodes);

            // Concat only if loading is deferred
            if (_this3.config.deferredLoading) {
              _this3.model = _this3.model.concat(newModel);
            } else {
              _this3.model = newModel;
            }

            // Set pagination
            _this3.model._pagination.total = nodes.length;
            if (parseInt(totalNodes, 10) > nodes.length) {
              _this3.model._pagination.total = parseInt(totalNodes, 10);
            }

            // Set pagination totals if resolver failed to provide them
            if (!totalNodes) {
              _this3.model.recurseDown(function (node) {
                if (node.hasChildren()) {
                  node.children._pagination.total = node.children.length;
                }
              });
            }
            _this3.autoSelectNode();
            var init = function init() {
              _this3.emit('model.loaded', _this3.model);
              resolve(_this3.model);
              _this3.model.applyChanges();
            };

            // Delay event for synchronous loader
            if (!_this3.initialized && isArray(nodes)) {
              setTimeout(init);
            } else {
              init();
            }
          }
Load data. Accepts an array, function, or promise.

@param {array|function|Promise} loader Array of nodes, function, or promise resolving an array of nodes.
@return {Promise<TreeNodes>} Promise resolved upon successful load, rejected on error.
@example

tree.load($.getJSON('nodes.json'));