Skip to content

Commit

Permalink
Fixed publishing and readme @PIE-3
Browse files Browse the repository at this point in the history
  • Loading branch information
murolem committed Jul 16, 2022
1 parent dfb3a34 commit 03a6583
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 60 deletions.
38 changes: 19 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,24 @@ Docs are available at the [project page](https://eleseer.github.io/eventer/).
* [Installation](#installation)
* [Usage](#usage)
* [Features](#features)
* [Add listeners, fire events, remove listeners](#features-basic)
* [Firing events just once](#features-firing-just-once)
* [Firing events without listeners](#features-fire-without-listeners)
* [Removing never-added listeners](#features-remove-not-added-listeners)
* [Type checking](#features-type-checking)
* [Adding listeners](#features-type-checking-adding-listeners)
* [Removing listeners](#features-type-checking-removing-listeners)
* [Firing events](#features-type-checking-firing-events)
* [Basics](#basics)
* [Firing events just once](#firing-events-just-once)
* [Firing events without listeners](#firing-events-without-listeners)
* [Removing never-added listeners](#removing-never-added-listeners)
* [Type-checking](#type-checking)
* [Adding listeners](#adding-listeners)
* [Removing listeners](#removing-listeners)
* [Firing events](#firing-events)

## <a name="installation"></a> Installation
## Installation

Using NPM

```bash
npm i @aliser/eventer
```

## <a name="usage"></a> Usage
## Usage

**Setup**

Expand Down Expand Up @@ -101,7 +101,7 @@ eventer.dispatchEvent('hello', { msg: 'Hello, world!' });
// no message is printed
```

## <a name="features"></a> Features
## Features

**Setup**

Expand All @@ -125,7 +125,7 @@ const byeListener = () => {
}
```
---
### <a name="features-basic"></a> **Add listeners, fire events, remove listeners**
### **Basics**

```ts
eventer.addEventListener('hello', helloListener);
Expand All @@ -144,7 +144,7 @@ eventer
```
<br>

### <a name="features-firing-just-once"></a> **Firing events just once**
### **Firing events just once**
```ts
eventer.addEventListener('hello', helloListener, { once: true });

Expand All @@ -156,7 +156,7 @@ eventer.dispatchEvent('hello', { msg: 'Hello, World!' });
```
<br>

### <a name="features-fire-without-listeners"></a> **Firing events without listeners**
### **Firing events without listeners**

Doesn't throw any errors.

Expand All @@ -166,7 +166,7 @@ eventer.dispatchEvent('bye');
```
<br>

### <a name="features-remove-not-added-listeners"></a> **Removing never-added listeners**
### **Removing never-added listeners**

Doesn't throw any errors.

Expand All @@ -176,8 +176,8 @@ eventer.removeEventListener('hello', helloListener);
```
<br>

### <a name="features-type-checking"></a> **Get a little bit of advanced (*and often confusing*) type-checking**
#### <a name="features-type-checking-adding-listeners"></a> **Adding listeners**
### **Type-checking**
#### **Adding listeners**
> Adding a listener to an event that **doesn't exist**.
```ts
Expand Down Expand Up @@ -211,7 +211,7 @@ eventer.addEventListener('hello', someEventListener);
```
<br>

#### <a name="features-type-checking-removing-listeners"></a> **Removing listeners**
#### **Removing listeners**
> Removing a listener that **expects data** from an event that **doesn't provide** any data.
```ts
eventer.removeEventListener('bye', helloListener);
Expand All @@ -231,7 +231,7 @@ eventer.removeEventListener('someEvent', helloListener);
```
<br>

#### <a name="features-type-checking-firing-events"></a> **Firing events**
#### **Firing events**

> Firing an event that **requires data** *without* providing **any data**.
Expand Down
Loading

0 comments on commit 03a6583

Please sign in to comment.