Skip to content

Commit

Permalink
badge & readme upd
Browse files Browse the repository at this point in the history
  • Loading branch information
Morglod committed Apr 9, 2023
1 parent b091d26 commit 62752ad
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
16 changes: 3 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[![NPM Version](https://badge.fury.io/js/tseep.svg?style=flat)](https://www.npmjs.com/package/tseep)
[![GitHub stars](https://img.shields.io/github/stars/Morglod/tseep.svg?style=social&label=Star&maxAge=2592000)](https://GitHub.com/Morglod/tseep/)

# tseep

Expand All @@ -13,9 +14,6 @@ Up to **x12** faster than `eventemitter3` in terms of "classic api event emitter
- Worlds fastest pure-js `EventEmitter`
- Fully tested with eventemitter3 tests

PS Uses `eval` for runtime codegenerations;
don't be afraid of it, all JS engines use it lol.

[how it works](./docs/how_it_works_en.md)

## Benchmarks
Expand Down Expand Up @@ -65,19 +63,13 @@ events.emit("foo", 123, "hello world");

!! **`__proto__`** event name is restricted (type guard exists) !!

<details>
<summary>
Full EventEmitter class api
</summary>

```ts

// Listener = (...args: any[]) => Promise<any>|void
// EventMap extends { [event in (string|symbol)]: Listener }

class EventEmitter<EventMap> {
maxListeners: number;
_eventsCount: number;
readonly maxListeners: number;
readonly _eventsCount: number;

emit(event: EventKey, ...args: ArgsN<EventMap[EventKey]>): boolean;
on(event: EventKey, listener: EventMap[EventKey]): this;
Expand All @@ -98,8 +90,6 @@ class EventEmitter<EventMap> {
}
```

</details>

## License

MIT
3 changes: 3 additions & 0 deletions docs/how_it_works_en.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# event emitter

PS Uses `eval` for runtime codegenerations;
don't be afraid of it, all JS engines use it lol.

## Switching Implementations

When calling emit, we also need to handle once listeners (which may not exist).
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tseep",
"version": "1.0.4",
"version": "1.0.5",
"description": "Fastest event emitter in the world",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down

0 comments on commit 62752ad

Please sign in to comment.