Skip to content

Commit 6276f9e

Browse files
committed
Update README.md
1 parent e74772a commit 6276f9e

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

README.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,26 @@ A TypeScript sourced event listener for efficient applications based on the [sub
1919
- **EventListener** "should" be able to manage event options, especially `once`, meaning that when the option is `true`, the listener is automatically un-subscribed and detached from target;
2020
- **EventListener** will unsubscribe and detach listeners with the same options used when attached, which means you can "lazy" remove listeners on the fly.
2121

22+
2223
# Install
2324

25+
```bash
26+
pnpm install -D @thednp/event-listener
27+
```
28+
29+
```bash
30+
yarn add -D @thednp/event-listener
31+
```
32+
33+
```bash
34+
npm install -D @thednp/event-listener
2435
```
25-
npm i @thednp/event-listener
36+
37+
```bash
38+
deno install -D npm:@thednp/event-listener@latest
2639
```
2740

41+
2842
## CDN
2943

3044
```html
@@ -68,14 +82,14 @@ const documentClickListeners = Listener.registry['click'].get(document);
6882

6983
// returns
7084
Map(1) {
71-
Entries(Array) => [
85+
Entries => [
7286
0: {
7387
key: handleMyClick() // listener
7488
value: false // listener options
7589
}
7690
],
7791
size: 1, // size of the Map
78-
prototype: [Prototype(Object)]
92+
prototype: [Prototype(Map)]
7993
}
8094

8195
// check if element has listener
@@ -101,7 +115,7 @@ const myListenerOptions = documentClickListeners && documentClickListeners.get(h
101115

102116
You can also make use of the types for more consistent code:
103117

104-
```js
118+
```ts
105119
import { on, FocusEventHandler } from '@thednp/event-listener';
106120

107121
const handleMyFocus: FocusEventHandler<HTMLInputElement> = (e) => {
@@ -120,7 +134,7 @@ For more advanced use, check out the [demo](https://thednp.github.io/event-liste
120134
- unpack/unzip and open the folder with your editor;
121135
- open your terminal and navigate to the root of the unpacked folder;
122136
- run `npm install` or `npm update`, takes a few minutes to download the Electron browser;
123-
- run `npm run cypress` to open the Cypress console OR `npm run test` to run the tests in headless mode.
137+
- run `npm run test-ui` to open the browser mode testing OR `npm run test` to run the tests in headless mode.
124138

125139
## License
126140

0 commit comments

Comments
 (0)