UnSubscribeToEvent

Unsubscribe to an event callback from a previously subscribed event

🔁 Function

void UnSubscribeToEvent(
    event: string, 
    componentName: string, 
    componentTypeName: string, 
    callback: string);

or

void UnSubscribeToEvent(
    event: string, 
    componentName: string, 
    componentTypeName: string, 
    callback: object);

⚙️ Parameters

Name Type Description
event String The name of the event to unsubscribe to
componentName String The name of the component that was invoking the event
componentTypeName String The type of the component. e.g. ‘PE Sensor’. See options
callback Object Can be a string (The name of the callback function) or the callback function itself

↩️ Return Value

None

📝 Example

function SubscribePESensor1()
{
    SubscribeToEvent('OnProductBlocking', 'PESensor1', 'PE Sensor', OnProductBlocking_PESensor1);
}

function UnsubscribePESensor1()
{
    UnSubscribeToEvent('OnProductBlocking', 'PESensor1', 'PE Sensor', OnProductBlocking_PESensor1);
}