Skip to content

Commit

Permalink
Clean up imperative mouseup example
Browse files Browse the repository at this point in the history
  • Loading branch information
domfarolino committed Jun 10, 2024
1 parent 6fc6b71 commit 187e4eb
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,13 @@ await element.on('mousemove')
```js
// Imperative
const controller = new AbortController();
element.addEventListener(
'mousemove',
(e) => {
element.addEventListener('mouseup', (e) => controller.abort());
console.log(e);
},
{ signal: controller.signal },
);
element.addEventListener('mousemove', e => {
console.log(e);

element.addEventListener('mouseup', e => {
controller.abort();
});
}, { signal: controller.signal });
```

</details>
Expand Down

0 comments on commit 187e4eb

Please sign in to comment.