src/Utility/External/FunctionQueue.js
/**
     * Adds a function to the FunctionQueue.
     * Automatically will wrap the function in a closure to keep the function context.
     *
     * @param {Function} func - The function to run
     * @param {Boolean} [toExec=true] - Whether to auto exec the FunctionQueue on add or not.
     * @param {...any} args - All arguments the function needs
     * @memberof FunctionQueue
     */
Adds a function to the FunctionQueue.
Automatically will wrap the function in a closure to keep the function context.

@param {Function} func - The function to run
@param {Boolean} [toExec=true] - Whether to auto exec the FunctionQueue on add or not.
@param {...any} args - All arguments the function needs
@memberof FunctionQueue
Adds a function to the FunctionQueue . Automatically will wrap the function in a closure to keep the function context . @param { Function } func - The function to run @param { Boolean } [ toExec = true ] - Whether to auto exec the FunctionQueue on add or not . @param { ... any } args - All arguments the function needs @memberof FunctionQueue
add(func, toExec = true, ...args) {
        const fn = this.createClosure(func, ...args);
        this._functions.queue(fn);
        if (toExec && !this._running) {
            this.exec();
        }
    }
add ( func , toExec = true , ... args ) { const fn = this . createClosure ( func , ... args ) ; this . _functions . queue ( fn ) ; if ( toExec && ! this . _running ) { this . exec ( ) ; } }
Adds a function to the FunctionQueue.
Adds a function to the FunctionQueue .