docs/vendor/mixitup/mixitup.js
function() {
            var self        = this,
                instruction = self.parseDatasetArgs(arguments),
                operation   = null,
                queueItem   = null,
                animate     = false;

            self.callActions('beforeDataset', arguments);

            if (!self.isBusy) {
                if (instruction.callback) self.userCallback = instruction.callback;

                animate = (instruction.animate ^ self.config.animation.enable) ? instruction.animate : self.config.animation.enable;

                operation = self.getDataOperation(instruction.command.dataset);

                return self.goMix(animate, operation);
            } else {
                queueItem = new mixitup.QueueItem();

                queueItem.args          = arguments;
                queueItem.instruction   = instruction;

                return self.queueMix(queueItem);
            }
        }
function() {
            var self        = this,
                instruction = self.parseDatasetArgs(arguments),
                operation   = null,
                queueItem   = null,
                animate     = false;

            self.callActions('beforeDataset', arguments);

            if (!self.isBusy) {
                if (instruction.callback) self.userCallback = instruction.callback;

                animate = (instruction.animate ^ self.config.animation.enable) ? instruction.animate : self.config.animation.enable;

                operation = self.getDataOperation(instruction.command.dataset);

                return self.goMix(animate, operation);
            } else {
                queueItem = new mixitup.QueueItem();

                queueItem.args          = arguments;
                queueItem.instruction   = instruction;

                return self.queueMix(queueItem);
            }
        }
function ( ) { var self = this , instruction = self . parseDatasetArgs ( arguments ) , operation = null , queueItem = null , animate = false ; self . callActions ( 'beforeDataset' , arguments ) ; if ( ! self . isBusy ) { if ( instruction . callback ) self . userCallback = instruction . callback ; animate = ( instruction . animate ^ self . config . animation . enable ) ? instruction . animate : self . config . animation . enable ; operation = self . getDataOperation ( instruction . command . dataset ) ; return self . goMix ( animate , operation ) ; } else { queueItem = new mixitup . QueueItem ( ) ; queueItem . args = arguments ; queueItem . instruction = instruction ; return self . queueMix ( queueItem ) ; } }
Updates the contents and order of the container to reflect the provided dataset,
if the dataset API is in use.

The dataset API is designed for use in API-driven JavaScript applications, and
can be used instead of DOM-based methods such as `.filter()`, `.sort()`,
`.insert()`, etc. When used, insertion, removal, sorting and pagination can be
achieved purely via changes to your data model, without the uglyness of having
to interact with or query the DOM directly.

@example

.dataset(dataset [, animate] [, callback])

@example <caption>Example 1: Rendering a dataset</caption>

var myDataset = [
{id: 1, ...},
{id: 2, ...},
{id: 3, ...}
];

mixer.dataset(myDataset)
.then(function(state) {
console.log(state.totalShow === 3); // true
});

@example <caption>Example 2: Sorting a dataset</caption>

// Create a new dataset in reverse order

var newDataset = myDataset.slice().reverse();

mixer.dataset(newDataset)
.then(function(state) {
console.log(state.activeDataset[0] === myDataset[2]); // true
});

@example <caption>Example 3: Removing an item from the dataset</caption>

console.log(myDataset.length); // 3

// Create a new dataset with the last item removed.

var newDataset = myDataset.slice().pop();

mixer.dataset(newDataset)
.then(function(state) {
console.log(state.totalShow === 2); // true
});

@public
@instance
@since       3.0.0
@param       {Array.<object>}    dataset
An array of objects, each one representing the underlying data model of a target to be rendered.
@param       {boolean}           [animate=true]
An optional boolean dictating whether the operation should animate, or occur syncronously with no animation. `true` by default.
@param       {function}          [callback=null]
An optional callback function to be invoked after the operation has completed.
@return      {Promise.<mixitup.State>}
A promise resolving with the current state object.
Updates the contents and order of the container to reflect the provided dataset if the dataset API is in use .