Stay organized with collections
Save and categorize content based on your preferences.
blockly > Block > loadExtraState
An optional serialization method for defining how to deserialize the block's extra state (eg mutation state) from something JSON compatible. This must be coupled with defining saveExtraState
.
Signature:
loadExtraState?: (p1: any) => void;
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-18 UTC."],[[["\u003cp\u003e\u003ccode\u003eloadExtraState\u003c/code\u003e is an optional method used to deserialize a block's extra state (like mutation state) from a JSON-compatible format.\u003c/p\u003e\n"],["\u003cp\u003eIt should be defined in conjunction with the \u003ccode\u003esaveExtraState\u003c/code\u003e method for proper serialization and deserialization of block state.\u003c/p\u003e\n"]]],["The `loadExtraState` property is an optional method used to deserialize a block's extra state, such as its mutation state, from a JSON-compatible format. It works in conjunction with the `saveExtraState` method. This method is defined within the `Block` class and takes a single parameter (`p1`) of any data type. It does not return any value and should define how the extra state should be loaded.\n"],null,["[blockly](./blockly.md) \\\u003e [Block](./blockly.block_class.md) \\\u003e [loadExtraState](./blockly.block_class.loadextrastate_property.md)\n\nBlock.loadExtraState property\n-----------------------------\n\nAn optional serialization method for defining how to deserialize the block's extra state (eg mutation state) from something JSON compatible. This must be coupled with defining `saveExtraState`.\n\n**Signature:** \n\n loadExtraState?: (p1: any) =\u003e void;"]]