The scripts can have one of the following forms:
'use strict';
api.subscribeFor('ExampleBuildingBlockType', test);
/**
* @param {BuildingBlockType} buildingblocktype
* @param {ChangeEvent} event
*/
function test(buildingblocktype, event) {
// React on the event
}
'use strict';
api.registerExecution(onDirectExecute);
function onDirectExecute() {
// Do something when the execution was triggered
}
Be advised
In any reaction script, do not use any direct statements other than
api.registerExecutionorapi.subscribeFor. All functionality has to be placed within functions. Scripts are executed arbitrarily by the Plugin system, so direct statements in the scripts will have unintended effects.