blockly > ContextMenu > callbackFactory
Funktion "ContextMenu.callbackFactory()"
Erstellen Sie eine Callback-Funktion, die einen Block erstellt und konfiguriert, dann den neuen Block neben dem Original platziert und ihn zurückgibt.
Unterschrift:
export declare function callbackFactory(block: Block, state: Element | serializationBlocks.State): () => BlockSvg;
Parameter
| Parameter | Typ | Beschreibung |
|---|---|---|
| Block | Blockieren | Ursprünglicher Block. |
| Bundesstaat | Element | serializationBlocks.State | XML- oder JSON-Objektdarstellung des neuen Blocks. |
Gibt zurück:
() => BlockSvg
Funktion, die einen Block erstellt.