-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* eslint-env node */ | ||
|
||
module.exports = { | ||
root: true, | ||
env: { | ||
node: true, | ||
}, | ||
extends: ['../.eslintrc.cjs'], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Examples | ||
|
||
These example scripts can be run in any JavaScript runtime that supports the prerequisites mentioned in the `README.md` in the repo root. Here's how to run one example using Node, Deno, or Bun: | ||
|
||
```sh | ||
# For the example named "basic.js": | ||
node basic.js | ||
deno run basic.js | ||
bun basic.js | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { Event, EventTarget } from '../src/index.js'; | ||
|
||
const eventTarget = new EventTarget(); | ||
const event = new Event('click', {}); | ||
eventTarget.addEventListener('click', (event) => { | ||
console.log(`Fired "${event.type}" event!`, event); | ||
}); | ||
eventTarget.dispatchEvent(event, 'abc'); |