r3-legacy/src/r3-socket-receive.js

65 lines
1.4 KiB
JavaScript

/**
* R3.Socket.Receive
* @param apiComponent
* @property receiveType
* @property destination
* @property destinationProperties
* @constructor
*/
R3.Socket.Receive = function(
apiComponent
) {
__RUNTIME_COMPONENT__;
R3.Socket.call(
this,
true
);
};
R3.Socket.Receive.prototype = Object.create(R3.Socket.prototype);
R3.Socket.Receive.prototype.constructor = R3.Socket.Receive;
R3.Socket.Receive.prototype.createInstance = function() {
R3.Socket.prototype.createInstance.call(this);
};
/**
* Updates the instance with the current state
*/
R3.Socket.Receive.prototype.updateInstance = function(property) {
if (property === 'receiveType') {
console.log('todo: implement receiveType update');
return;
}
if (property === 'destination') {
console.log('todo: implement destination update');
return;
if (this.destination !== null) {
this.destinationProperties = R3.Utils.ObjectPropertiesAsBoolean(this.destination);
} else {
this.destinationProperties = {};
}
R3.Event.Emit(
R3.Event.RECEIVE_DESTINATION_CHANGED,
{
component:this
}
)
}
if (property === 'destinationProperties') {
console.log('todo: implement destinationProperties update');
return;
}
R3.Socket.prototype.updateInstance.call(this, property);
};