Skip to main content

Home > blockly > utils > extensions > apply

utils.extensions.apply() function

Applies an extension method to a block. This should only be called during block construction.

Signature:

export declare function apply(name: string, block: Block, isMutator: boolean): void;

Parameters

ParameterTypeDescription
namestringThe name of the extension.
blockBlockThe block to apply the named extension to.
isMutatorbooleanTrue if this extension defines a mutator.

Returns:

void

Exceptions

{Error} if the extension is not found.