Description
This object is being used to debounce triggers, which means that the trigger will be forwarded after the delay period and all additional triggers into the ‘In’ will be ignored during that period.
App Builder Object
Source Code
function execute() { if (!context.delay) { context.delay = parseInt(inPorts[1].value, 10) || 2000; } switch (trigger) { case TRIGGERS.SYSTEM_SYNC: { context.blocked = false; break; } case 0: { if (!context.blocked) { context.blocked = true; syncSleep(context.delay); return [new Date()]; } break; } case 1: { context.delay = inPorts[1].value; break; } default: break; } return []; }
In Ports
Position | Name | Message Type | Description |
---|---|---|---|
1 | In | Trigger | This port is being used to trigger the 'Debounce' object. |
2 | Delay (ms) | Number | This port is being used to set the delay of the ‘Debounce’. |
Out Ports
Position | Name | Message Type | Description |
---|---|---|---|
1 | Out | Trigger | This port is being used to trigger only once during the set delay, even if more trigger are being sent to the 'Debounce' Object. |
Properties
Name | Description |
---|---|
Object Name | The name on the object on the canvas. |
Show Code View | The switch to turn on code view for the Code Object. |
Duplicate Code into custom Code Object |