async init({onFinished, urlCache} = {}) {
        this.onFinished = onFinished;

        let persistedUrls;
        let persistedResources;

        if (this.cache && (labs.isSet('urlCache') || urlCache)) {
            persistedUrls = await this.cache.read('urls');
            persistedResources = await this.cache.read('resources');
        }

        if (persistedUrls && persistedResources) {
            this.urls.urls = persistedUrls;
            this.resources.data = persistedResources;
            this.resources.initResourceConfig();
            this.resources.initEvenListeners();

            this._onQueueEnded('init');
        } else {
            this.resources.initResourceConfig();
            this.resources.initEvenListeners();
            await this.resources.fetchResources();
            // CASE: all resources are fetched, start the queue
            this.queue.start({
                event: 'init',
                tolerance: 100,
                requiredSubscriberCount: 1
            });
        }
    }
/**
     * @description Initializes components needed for the URL Service to function
     * @param {Object} options
     * @param {Function} [options.onFinished] - callback when url generation is finished
     * @param {Boolean} [options.urlCache] - whether to init using url cache or not
     */
@description Initializes components needed for the URL Service to function
@param {Object} options
@param {Function} [options.onFinished] - callback when url generation is finished
@param {Boolean} [options.urlCache] - whether to init using url cache or not
@description Initializes components needed for the URL Service to function @param { Object } options @param { Function } [ options . onFinished ] - callback when url generation is finished @param { Boolean } [ options . urlCache ] - whether to init using url cache or not
async init({onFinished, urlCache} = {}) {
        this.onFinished = onFinished;
        let persistedUrls;
        let persistedResources;
        if (this.cache && (labs.isSet('urlCache') || urlCache)) {
            persistedUrls = await this.cache.read('urls');
            persistedResources = await this.cache.read('resources');
        }
        if (persistedUrls && persistedResources) {
            this.urls.urls = persistedUrls;
            this.resources.data = persistedResources;
            this.resources.initResourceConfig();
            this.resources.initEvenListeners();
            this._onQueueEnded('init');
        } else {
            this.resources.initResourceConfig();
            this.resources.initEvenListeners();
            await this.resources.fetchResources();
            this.queue.start({
                event: 'init',
                tolerance: 100,
                requiredSubscriberCount: 1
            });
        }
    }
async init ( { onFinished , urlCache } = { } ) { this . onFinished = onFinished ; let persistedUrls ; let persistedResources ; if ( this . cache && ( labs . isSet ( 'urlCache' ) || urlCache ) ) { persistedUrls = await this . cache . read ( 'urls' ) ; persistedResources = await this . cache . read ( 'resources' ) ; } if ( persistedUrls && persistedResources ) { this . urls . urls = persistedUrls ; this . resources . data = persistedResources ; this . resources . initResourceConfig ( ) ; this . resources . initEvenListeners ( ) ; this . _onQueueEnded ( 'init' ) ; } else { this . resources . initResourceConfig ( ) ; this . resources . initEvenListeners ( ) ; await this . resources . fetchResources ( ) ; this . queue . start ( { event : 'init' , tolerance : 100 , requiredSubscriberCount : 1 } ) ; } }
@description Initializes components needed for the URL Service to function
 @param {Object} options
 @param {Function} [options.onFinished] - callback when url generation is finished
 @param {Boolean} [options.urlCache] - whether to init using url cache or not
@description Initializes components needed for the URL Service to function @param { Object } options @param { Function } [ options . onFinished ] - callback when url generation is finished @param { Boolean } [ options . urlCache ] - whether to init using url cache or not
// CASE: all resources are fetched, start the queue