Skip to content

Commit

Permalink
[DOCS] new option in the on helper added to the documentation (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
franpb14 authored Jan 17, 2025
1 parent c78c5bc commit ea73980
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/HELPERS_API.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,14 +236,14 @@ setParam({ a: 1, b: 2 })

## Events

### `on(query, events, callback)`
### `on(query, events, callback, options = {})`

Wraps `addEventListener`. Example:

```js
on(document, 'scroll', (e) => {
addClass('body', 'scrolling')
})
on(document, 'click', (e) => {
addClass('.welcome-message', 'hide')
}, { once: true })
```

Accepts multiple events:
Expand Down

0 comments on commit ea73980

Please sign in to comment.