Stay organized with collections
Save and categorize content based on your preferences.
blockly > serialization > workspaces > load
serialization.workspaces.load() function
Loads the variable represented by the given state into the given workspace.
Signature:
export declare function load(state: {
[key: string]: any;
}, workspace: Workspace, { recordUndo }?: {
recordUndo?: boolean;
}): void;
Parameters
Parameter |
Type |
Description |
state |
{ [key: string]: any; } |
The state of the workspace to deserialize into the workspace. |
workspace |
Workspace |
The workspace to add the new state to. |
{ recordUndo } |
{ recordUndo?: boolean; } |
(Optional) |
Returns:
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."],[[["The `serialization.workspaces.load()` function imports a workspace's state, defined by a JSON object, into a specified Blockly workspace."],["This function takes the workspace state, target workspace, and an optional flag for undo recording as parameters."],["It deserializes the provided state data and integrates it into the designated workspace without returning any specific value."]]],["The `serialization.workspaces.load()` function loads a workspace's state into a designated workspace. It takes a `state` object, containing the workspace's data, and a `workspace` object, where the data will be loaded. Optionally, it accepts a `recordUndo` boolean to track changes. The function modifies the given `workspace` by deserializing the provided `state` into it. It returns nothing.\n"]]