Skip to main content

blockly > registry > getObject

registry.getObject() function

Gets the object for the given name and type.

Signature:

export declare function getObject<T>(type: string | Type<T>, name: string, opt_throwIfMissing?: boolean): T | null;

Parameters

Parameter

Type

Description

type

string | Type<T>

The type of the plugin. (e.g. Category)

name

string

The plugin's name. (Ex. logic_category)

opt_throwIfMissing

boolean

(Optional) Whether or not to throw an error if we are unable to find the object.

Returns:

T | null

The object with the given name and type or null if none exists.