Skip to content

Commit

Permalink
Fix 1:6
Browse files Browse the repository at this point in the history
  • Loading branch information
NullVoxPopuli committed May 29, 2024
1 parent 2f9d2c9 commit 75b7a00
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ let data = {
terrain: "desert",
};

let { JSON } = globalThis;

localStorage.setItem('localStorage-item', JSON.stringify(data));

// Pending update to GlimmerVM that does this automatically
let getItem = localStorage.getItem.bind(localStorage);
let get = (key) => localStorage.getItem(key);

<template>
From localStorage: <br>
<pre>{{getItem "localStorage-item"}}</pre>
<pre>{{get "localStorage-item"}}</pre>

Formatted: <br>
<pre><code>{{JSON.stringify data null "\t"}}</code></pre>
<pre><code>{{JSON.stringify data null " "}}</code></pre>
</template>
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ let data = {
terrain: "desert",
};

let { JSON } = globalThis;

localStorage.setItem('localStorage-item', JSON.stringify(data));

// Pending update to GlimmerVM that does this automatically
let getItem = localStorage.getItem.bind(localStorage);
let get = (key) => localStorage.getItem(key);

<template>
From localStorage: <br>
Expand Down

0 comments on commit 75b7a00

Please sign in to comment.