{"result":{"depiction_url":null,"edges":{"subject":{"objects":[{"created":"2026-09-30T09:11:24Z","object_id":{"id":2555,"is_a":["categorization","keyword","keyword_information_type"],"name":"zotonic_topic_reference","title":"Reference","uri":"https:\/\/zotonic.com\/id\/2555"},"seq":1},{"created":"2026-09-30T09:11:24Z","object_id":{"id":2563,"is_a":["categorization","keyword","keyword_audience"],"name":"zotonic_topic_frontend_developer","title":"Frontend developer","uri":"https:\/\/zotonic.com\/id\/2563"},"seq":2},{"created":"2026-09-30T09:11:24Z","object_id":{"id":2625,"is_a":["categorization","keyword","keyword_architecture"],"name":"zotonic_topic_model","title":"Model","uri":"https:\/\/zotonic.com\/id\/2625"},"seq":3},{"created":"2026-09-30T09:11:24Z","object_id":{"id":2673,"is_a":["categorization","keyword","keyword_technology"],"name":"zotonic_topic_javascript","title":"JavaScript","uri":"https:\/\/zotonic.com\/id\/2673"},"seq":4},{"created":"2026-09-30T09:11:24Z","object_id":{"id":2713,"is_a":["categorization","keyword","keyword_domain"],"name":"zotonic_topic_browser_storage","title":"Browser storage","uri":"https:\/\/zotonic.com\/id\/2713"},"seq":5},{"created":"2026-09-30T09:11:24Z","object_id":{"id":2718,"is_a":["categorization","keyword","keyword_technology"],"name":"zotonic_topic_cotonic","title":"Cotonic","uri":"https:\/\/zotonic.com\/id\/2718"},"seq":6}],"predicate":{"id":308,"is_a":["meta","predicate"],"name":"subject","title":{"_type":"trans","tr":{"en":"Keyword"}},"uri":"http:\/\/purl.org\/dc\/elements\/1.1\/subject"}}},"id":2741,"is_a":["text","documentation","reference","cotonic_reference","cotonic_model"],"links":[{"rel":"self","target":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/2741"},{"rel":"hub","target":"https:\/\/zotonic.com\/.zotonic\/websub"}],"medium":null,"medium_url":null,"name":"doc_cotonic_model_localstorage","page_url":{"en":"https:\/\/zotonic.com\/cotonic\/models\/localstorage","x-default":"https:\/\/zotonic.com\/cotonic\/models\/localstorage"},"preview_url":null,"resource":{"version":15,"pivot_location_lat":null,"title":"model\/localStorage","is_authoritative":true,"body":"<a name=\"model.localStorage\"><\/a><h3>model\/localStorage<\/h3>\n\n            <a name=\"model.localStorage.get.key\"><\/a><h4>get\/+key<\/h4><p>\n            Gets item <tt>key<\/tt> from localStorage. Returns the content as payload.\n            <\/p>\n            <pre>\ncotonic.broker.call(&quot;model\/localStorage\/get\/a&quot;)\n.then(\n    function(m) {\n        console.log(&quot;a is set to:&quot;, m.payload)\n    }\n);<\/pre>\n\n\n            <a name=\"model.localStorage.post.key\"><\/a><h4>post\/+key<\/h4><p>\n            Update, or insert message under <tt>key<\/tt> in localStorage.\n            <\/p>\n            <pre>\ncotonic.broker.publish(&quot;model\/localStorage\/post\/a&quot;, &quot;Hello world!&quot;);<\/pre>\n\n            <a name=\"model.localStorage.delete.key\"><\/a><h4>delete\/+key<\/h4><p>\n            Delete item stored under <tt>key<\/tt> from localStorage.\n            <\/p>\n            <pre>\ncotonic.broker.publish(&quot;model\/localStorage\/delete\/a&quot;);<\/pre>\n\n            <a name=\"model.localStorage.event.key\"><\/a><h4>event\/+key<\/h4><p>\n            Subscribe to changes or deletions from localStorage. When the message payload\n            is <tt>null<\/tt> the item is delete. Otherwise the payload is set to the\n            newly updated value.\n            <\/p>\n            <pre>\ncotonic.broker.subscribe(&quot;model\/localStorage\/event\/+key&quot;,\n    function(m, a) {\n        if(m.payload === null) {\n            console.log(&quot;localStorage item:&quot;, a.key, &quot;deleted&quot;);\n        else {\n            console.log(&quot;localStorage item:&quot;, a.key, &quot;changed&quot;, m.payload);\n        }\n    });\n=&gt; Logs update to localStorage elements.<\/pre>\n\n            <a name=\"model.localStorage.event.ping\"><\/a><h4>event\/ping<\/h4><p>\n            When the localStorage model is enabled it publishes a retained message\n            under the topic <tt>model\/localStorage\/event\/ping<\/tt>. It makes it\n            possible to detect the localStorage model is enabled.\n            <\/p>\n            <pre>\ncotonic.broker.subscribe(&quot;model\/localStorage\/event\/ping&quot;,\n    function() {\n        console.log(&quot;localStorage is enabled&quot;);\n    });<\/pre>\n\n            ","slug":"model-localstorage","is_protected":false,"visible_for":0,"tz":"UTC","language":["en"],"doc_source_hash":"baaabe343c21c8322d2944542e4abc6c1a1b0c3ae3982092e88a2c6e33183837","is_featured":false,"content_group_id":{"id":2551,"is_a":["meta","content_group"],"name":"content_group_imported_docs","title":"Imported documentation","uri":"https:\/\/zotonic.com\/id\/content_group_imported_docs"},"category_id":{"id":2723,"is_a":["meta","category"],"name":"cotonic_model","title":"Cotonic models","uri":"https:\/\/zotonic.com\/id\/cotonic_model"},"doc_source_path":"index.html","publication_start":"2026-09-30T09:11:24Z","page_path":"\/cotonic\/models\/localstorage","github_url":"https:\/\/github.com\/cotonic\/cotonic\/blob\/master\/index.html","pivot_location_lng":null,"doc_source_kind":"cotonic","name":"doc_cotonic_model_localstorage","is_unfindable":false,"is_published":true,"pivot_geocode":null,"created":"2026-09-30T09:11:24Z","uri":null,"doc_source_anchor":"model.localStorage","doc_status":"current","is_dependent":false,"publication_end":"9999-06-01T00:00:00Z","modifier_id":{"id":1,"is_a":["person"],"name":"administrator","title":"Site Administrator","uri":"https:\/\/zotonic.com\/id\/1"},"privacy":0,"doc_source_commit":"f88cc928b997d10f7f19e6bd0ede80e1c8c619bc","creator_id":{"id":1,"is_a":["person"],"name":"administrator","title":"Site Administrator","uri":"https:\/\/zotonic.com\/id\/1"},"modified":"2026-09-30T09:57:32Z","title_slug":"model-localstorage"},"uri":"https:\/\/zotonic.com\/id\/2741","uri_template":"https:\/\/zotonic.com\/id\/:id","websub":{"hub":"https:\/\/zotonic.com\/.zotonic\/websub","topic":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/2741"}},"status":"ok"}