lib/init.js
function $createClient(options) {
        /*
         * Ensure we have default options.
         */
        options = extend({}, {}, options);

        const { url, transport } = options;

        if (_clients[url]) {
            return _clients[url];
        }

        const client = mqtt.connect(url, transport);

        _clients[url] = client;

        return client;
    }
function $createClient(options) {
        /*
         * Ensure we have default options.
         */
        options = extend({}, {}, options);

        const { url, transport } = options;

        if (_clients[url]) {
            return _clients[url];
        }

        const client = mqtt.connect(url, transport);

        _clients[url] = client;

        return client;
    }
function $createClient ( options ) { /*
         * Ensure we have default options.
         */ options = extend ( { } , { } , options ) ; const { url , transport } = options ; if ( _clients [ url ] ) { return _clients [ url ] ; } const client = mqtt . connect ( url , transport ) ; _clients [ url ] = client ; return client ; }
Factory function to create MQTT client.
The default factory creates a regular MQTT.js
client.
@param {Object} options MQTT configuration object
Factory function to create MQTT client . The default factory creates a regular MQTT . js client .