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.
[null,null,["Last updated 2024-09-18 UTC."],[[["`loadExtraState` is an optional method used to deserialize a block's extra state (like mutation state) from a JSON-compatible format."],["It should be defined in conjunction with the `saveExtraState` method for proper serialization and deserialization of block state."]]],["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"]]