Stay organized with collections Save and categorize content based on your preferences.

blockly > Block > setOnChange

Block.setOnChange() method

Sets a callback function to use whenever the block's parent workspace changes, replacing any prior onchange handler. This is usually only called from the constructor, the block type initializer function, or an extension initializer function.

Signature:

setOnChange(onchangeFn: (p1: Abstract) => any): void;

Parameters

Parameter Type Description
onchangeFn (p1: Abstract) => any The callback to call when the block's workspace changes.

Returns:

void

Exceptions

{Error} if onchangeFn is not falsey and not a function.