Stay organized with collections
Save and categorize content based on your preferences.
blockly > icons > CommentIcon > saveState
Signature:
saveState(): CommentState | null;
Returns:
CommentState | null
the state of the comment as a JSON serializable value if the comment has text. Otherwise returns null.
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\u003eThe \u003ccode\u003eicons.CommentIcon.saveState()\u003c/code\u003e method is used to obtain the current state of a comment icon.\u003c/p\u003e\n"],["\u003cp\u003eIt returns a \u003ccode\u003eCommentState\u003c/code\u003e object containing the comment's state if it has text, otherwise it returns \u003ccode\u003enull\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe returned \u003ccode\u003eCommentState\u003c/code\u003e object can be serialized to JSON for storage or transfer.\u003c/p\u003e\n"]]],["The `icons.CommentIcon.saveState()` method captures the state of a comment. It returns a `CommentState` object, which is a JSON-serializable representation of the comment's text content. If the comment lacks text, the method returns `null`. This method's purpose is to serialize the comment's data for saving or other operations requiring a structured data format.\n"],null,["[blockly](./blockly.md) \\\u003e [icons](./blockly.icons_namespace.md) \\\u003e [CommentIcon](./blockly.icons_namespace.commenticon_class.md) \\\u003e [saveState](./blockly.icons_namespace.commenticon_class.savestate_1_method.md)\n\nicons.CommentIcon.saveState() method\n\n**Signature:** \n\n saveState(): CommentState | null;\n\n**Returns:**\n\n[CommentState](./blockly.icons_namespace.commentstate_interface.md) \\| null\n\nthe state of the comment as a JSON serializable value if the comment has text. Otherwise returns null."]]