blueocean-core-js/src/js/capability/CapabilityStore.js
/**
     * Fetch the capabilities for one or more class names.
     * Will used cached values if available.
     *
     * @param classNames
     * @returns {Promise} with fulfilled {object} keyed by className, with an array of string capability names.
     */
Fetch the capabilities for one or more class names.
Will used cached values if available.

@param classNames
@returns {Promise} with fulfilled {object} keyed by className, with an array of string capability names.
Fetch the capabilities for one or more class names . Will used cached values if available . @param classNames @returns { Promise } with fulfilled { object } keyed by className with an array of string capability names .
resolveCapabilities(...classNames) {
        const result = {};
        const classesToFetch = [];
        for (const className of classNames) {
            const classInfo = this._getStoredClassInfo(className);
            if (classInfo) {
                result[className] = classInfo;
            } else {
                classesToFetch.push(className);
            }
        }
        if (classesToFetch.length === 0) {
            return new Promise(resolve => resolve(result));
        }
        return this._fetchCapabilities(classesToFetch).then(fetchedCapabilities => Object.assign(result, fetchedCapabilities));
    }
resolveCapabilities ( ... classNames ) { const result = { } ; const classesToFetch = [ ] ; for ( const className of classNames ) { const classInfo = this . _getStoredClassInfo ( className ) ; if ( classInfo ) { result [ className ] = classInfo ; } else { classesToFetch . push ( className ) ; } } if ( classesToFetch . length === 0 ) { return new Promise ( resolve => resolve ( result ) ) ; } return this . _fetchCapabilities ( classesToFetch ) . then ( fetchedCapabilities => Object . assign ( result , fetchedCapabilities ) ) ; }
Fetch the capabilities for one or more class names.
Fetch the capabilities for one or more class names .
// determine which class names are already in the cache and which aren't // if nothing to fetch, just return an immediately fulfilled Promise // fetch the capabilities and then merge that with the values already in the cache