File tree 2 files changed +8
-6
lines changed
apps/tutorial/public/docs/1-introduction/6-browser-utilities
2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -4,15 +4,16 @@ let data = {
4
4
terrain: " desert" ,
5
5
};
6
6
7
+ let { JSON } = globalThis ;
8
+
7
9
localStorage .setItem (' localStorage-item' , JSON .stringify (data));
8
10
9
- // Pending update to GlimmerVM that does this automatically
10
- let getItem = localStorage .getItem .bind (localStorage);
11
+ let get = (key ) => localStorage .getItem (key);
11
12
12
13
<template >
13
14
From localStorage: <br >
14
- <pre >{{getItem " localStorage-item" }} </pre >
15
+ <pre >{{get " localStorage-item" }} </pre >
15
16
16
17
Formatted: <br >
17
- <pre ><code >{{JSON.stringify data null " \t " }} </code ></pre >
18
+ <pre ><code >{{JSON.stringify data null " " }} </code ></pre >
18
19
</template >
Original file line number Diff line number Diff line change @@ -4,10 +4,11 @@ let data = {
4
4
terrain: " desert" ,
5
5
};
6
6
7
+ let { JSON } = globalThis ;
8
+
7
9
localStorage .setItem (' localStorage-item' , JSON .stringify (data));
8
10
9
- // Pending update to GlimmerVM that does this automatically
10
- let getItem = localStorage .getItem .bind (localStorage);
11
+ let get = (key ) => localStorage .getItem (key);
11
12
12
13
<template >
13
14
From localStorage: <br >
You can’t perform that action at this time.
0 commit comments