lib/app/helper/socket_helper.js
function onResponse(packet) {

		if (typeof that.callbacks[packet.respond_to] === 'function') {

			try {
				if (packet.data) {
					packet.data = JSON.undry(packet.data);
				}
			} catch (err) {
				console.log('ERROR UNDRYING PACKET:', err);
				return;
			}

			if (packet.noData) {
				that.callbacks[packet.respond_to](packet.err, packet.stream);
			} else if (packet.stream) {
				that.callbacks[packet.respond_to](packet.err, packet.data, packet.stream);
			} else {
				that.callbacks[packet.respond_to](packet.err, packet.data);
			}
		}

		delete that.callbacks[packet.respond_to];
	}
function onResponse(packet) {

		if (typeof that.callbacks[packet.respond_to] === 'function') {

			try {
				if (packet.data) {
					packet.data = JSON.undry(packet.data);
				}
			} catch (err) {
				console.log('ERROR UNDRYING PACKET:', err);
				return;
			}

			if (packet.noData) {
				that.callbacks[packet.respond_to](packet.err, packet.stream);
			} else if (packet.stream) {
				that.callbacks[packet.respond_to](packet.err, packet.data, packet.stream);
			} else {
				that.callbacks[packet.respond_to](packet.err, packet.data);
			}
		}

		delete that.callbacks[packet.respond_to];
	}
function onResponse ( packet ) { if ( typeof that . callbacks [ packet . respond_to ] === 'function' ) { try { if ( packet . data ) { packet . data = JSON . undry ( packet . data ) ; } } catch ( err ) { console . log ( 'ERROR UNDRYING PACKET:' , err ) ; return ; } if ( packet . noData ) { that . callbacks [ packet . respond_to ] ( packet . err , packet . stream ) ; } else if ( packet . stream ) { that . callbacks [ packet . respond_to ] ( packet . err , packet . data , packet . stream ) ; } else { that . callbacks [ packet . respond_to ] ( packet . err , packet . data ) ; } } delete that . callbacks [ packet . respond_to ] ; }
The function that handles responses
The function that handles responses