Exemple #1
0
    constructor () {

        this.baseURL = '';

        this.path = '';

        this.tag = '';

        this.enableParallel = true;

        this.maxParallelDownloads = 4;

        //  xhr specific global settings (can be overridden on a per-file basis)
        this.xhr = XHRSettings();

        this.crossOrigin = undefined;

        this.list = new Set();
        this.inflight = new Set();
        this.failed = new Set();
        this.queue = new Set();
        this.storage = new Set();

        this._state = PENDING;
        this._resolve = undefined;
        this._reject = undefined;

    }
Exemple #2
0
export default function MergeXHRSettings (global, local) {

    let output = (global === undefined) ? XHRSettings() : Object.assign(global);

    if (local)
    {
        for (let setting in local)
        {
            if (local[setting] !== undefined)
            {
                output[setting] = local[setting];
            }
        }
    }

    return output;

}