src/simple-mqtt-client/client.js
function subscribeNode (client, subscriptions, channel, callback, done_callback) {
    if (subscriptions[channel]===undefined) {
        subscriptions[channel] = [callback];
        client.subscribe(channel, {qos: 0}, function() {
            // If there is a done_callback defined, execute it
            if (done_callback!==undefined) done_callback();
        });
    } else {
        subscriptions[channel].push(callback);
    }
}
function subscribeNode (client, subscriptions, channel, callback, done_callback) {
    if (subscriptions[channel]===undefined) {
        subscriptions[channel] = [callback];
        client.subscribe(channel, {qos: 0}, function() {
            // If there is a done_callback defined, execute it
            if (done_callback!==undefined) done_callback();
        });
    } else {
        subscriptions[channel].push(callback);
    }
}
function subscribeNode ( client , subscriptions , channel , callback , done_callback ) { if ( subscriptions [ channel ] === undefined ) { subscriptions [ channel ] = [ callback ] ; client . subscribe ( channel , { qos : 0 } , function ( ) { // If there is a done_callback defined, execute it if ( done_callback !== undefined ) done_callback ( ) ; } ) ; } else { subscriptions [ channel ] . push ( callback ) ; } }
Helper function that subscribes to a channel in node
Helper function that subscribes to a channel in node