Skip to content

Commit 76a1389

Browse files
authored
make visited a boolean (#539)
Co-authored-by: Rich Harris <[email protected]>
1 parent f0cf7ad commit 76a1389

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

content/tutorial/03-sveltekit/04-headers-and-cookies/02-cookies/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export function load(+++{ cookies }+++) {
1212
+++const visited = cookies.get('visited');+++
1313

1414
return {
15-
visited
15+
visited: visited === 'true'
1616
};
1717
}
1818
```
@@ -27,7 +27,7 @@ export function load({ cookies }) {
2727
+++cookies.set('visited', 'true', { path: '/' });+++
2828

2929
return {
30-
visited
30+
visited: visited === 'true'
3131
};
3232
}
3333
```
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export function load() {
2-
const visited = false;
2+
const visited = 'false';
33

44
return {
5-
visited
5+
visited: visited === 'true'
66
};
77
}

0 commit comments

Comments
 (0)