createServiceClients(app, serviceConfig = {}) {
        return Object.values(serviceConfig)
            .reduce((serviceClients, conf) => {
                // get the assigned data source
                const dataSource = app.dataSources[conf.dataSource];
                this.normalizeDataSource(dataSource);
                // instantiate the client
                const client = new ServiceClient(conf, dataSource);
                // if the client is configured to be auto discovered, trigger the discovery
                if (client.autoDiscoveryEnabled) {
                    client.discover().catch(error => this._handleDiscoveryError(error));
                }
                // map the client to the services name
                serviceClients.set(client.serviceName, client);
                return serviceClients;
            }, new Map());
    }
/**
     * Creates a map containing service clients mapped to their serviceName.
     *
     * This also initializes the discovery if the service is configured to be auto-discovered.
     *
     * @param {ExpressApp} app - the app given by Loopback
     * @param {Object} serviceConfig - the service configuration given to the component
     * @return {Map<{String}, {ServiceClient}>}
     */
Creates a map containing service clients mapped to their serviceName.
This also initializes the discovery if the service is configured to be auto-discovered.

@param {ExpressApp} app - the app given by Loopback
@param {Object} serviceConfig - the service configuration given to the component
@return {Map<{String}, {ServiceClient}>}
Creates a map containing service clients mapped to their serviceName . This also initializes the discovery if the service is configured to be auto - discovered . @param { ExpressApp } app - the app given by Loopback @param { Object } serviceConfig - the service configuration given to the component @return { Map< { String } { ServiceClient } > }
createServiceClients(app, serviceConfig = {}) {
        return Object.values(serviceConfig)
            .reduce((serviceClients, conf) => {
                const dataSource = app.dataSources[conf.dataSource];
                this.normalizeDataSource(dataSource);
                const client = new ServiceClient(conf, dataSource);
                if (client.autoDiscoveryEnabled) {
                    client.discover().catch(error => this._handleDiscoveryError(error));
                }
                serviceClients.set(client.serviceName, client);
                return serviceClients;
            }, new Map());
    }
createServiceClients ( app , serviceConfig = { } ) { return Object . values ( serviceConfig ) . reduce ( ( serviceClients , conf ) => { const dataSource = app . dataSources [ conf . dataSource ] ; this . normalizeDataSource ( dataSource ) ; const client = new ServiceClient ( conf , dataSource ) ; if ( client . autoDiscoveryEnabled ) { client . discover ( ) . catch ( error => this . _handleDiscoveryError ( error ) ) ; } serviceClients . set ( client . serviceName , client ) ; return serviceClients ; } , new Map ( ) ) ; }
Creates a map containing service clients mapped to their serviceName.
Creates a map containing service clients mapped to their serviceName .
// get the assigned data source // instantiate the client // if the client is configured to be auto discovered, trigger the discovery // map the client to the services name