Skip to content

Commit

Permalink
Merge branch 'master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
1cg committed Aug 4, 2023
2 parents 1f65858 + 3fddca9 commit 13429a7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions www/expressions/cookies.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ title: cookies - ///_hyperscript

The cookies symbol is not a proper expression, but rather a value assigned, by default, to the `cookies` symbol. This
value presents a better API than the standard [`document.cookie`](https://developer.mozilla.org/en-US/docs/web/api/document/cookie)
API, making it cookies work more like [`window.localStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage)
API, making cookies work more like [`window.localStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage)

The API of the `cookies` symbol is as follows:

Expand All @@ -25,7 +25,7 @@ The API of the `cookies` symbol is as follows:
| cookies.length | returns the total number of cookies | `log cookies.length` |
| cookies[<number>] | returns the nth cookie | `log cookies[0]` |
| cookies.clear(<cookie name>) | clears a given cookie | `cookies.clear('foo')` |
| cookies.clearAll() | clears all cookies | `cookies.clear('foo')` |
| cookies.clearAll() | clears all cookies | `cookies.clearAll()` |

In addition to this, the `cookies` symbol can be iterated over:

Expand All @@ -51,5 +51,7 @@ The attributes of the the javascript object will be interpreted as follows:
### Examples

```html
<div _="on click wait 2s then log 'hello world'">Hello World!</div>
<button _="on click set cookies.hello to 'world'">
Set the cookie 'hello' to 'world'!
</button>
```
2 changes: 1 addition & 1 deletion www/posts/2023-06-30-hyperscript-0.9.9-is-released.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ We are pleased to present the [0.9.9 release](https://unpkg.com/browse/hyperscri

### Changes

* A new [cookie API](/expressions/cookes) was added
* A new [cookie API](/expressions/cookies) was added
* The `beep!` print-debug tool can now be used [as a command](/commands/beep)
* The [comparison expression](/expressions/comparison-operator) now supports additional syntax:
* `is equal to`
Expand Down

0 comments on commit 13429a7

Please sign in to comment.