src/Utility/External/Queue.js
/**
     * Queue up an element.
     *
     * @param {T} elem
     * @param {Boolean} [replaceOnMax] - Whether to replace value when adding if max is reached (dequeue first element and queue new element)
     * @returns {Boolean} Whether element was successfully added
     * @memberof Queue
     */
Queue up an element.
@param {T} elem
@param {Boolean} [replaceOnMax] - Whether to replace value when adding if max is reached (dequeue first element and queue new element)
@returns {Boolean} Whether element was successfully added
@memberof Queue
Queue up an element . @param { T } elem @param { Boolean } [ replaceOnMax ] - Whether to replace value when adding if max is reached ( dequeue first element and queue new element ) @returns { Boolean } Whether element was successfully added @memberof Queue
queue(elem, replaceOnMax) {
        if (this.max && this._elements.length === this.max) {
            if ( (replaceOnMax !== undefined) ? replaceOnMax : this.replaceOnMax) {
                this._elements.shift();
            } else {
                return false;
            }
        }
        this._elements.push(elem);
        return true;
    }
queue ( elem , replaceOnMax ) { if ( this . max && this . _elements . length === this . max ) { if ( ( replaceOnMax !== undefined ) ? replaceOnMax : this . replaceOnMax ) { this . _elements . shift ( ) ; } else { return false ; } } this . _elements . push ( elem ) ; return true ; }
Queue up an element.
Queue up an element .