#

API Docs for: 0.6.0
Show: Inherited Protected Private Deprecated

# EventTarget Class

Defined in: `src/utils/EventTarget.js:1`

Base class for objects that dispatches events.

## Constructor

### `EventTarget`

()

Defined in `src/utils/EventTarget.js:1`

- Index
- Methods

## Item Index

### Methods

- addEventListener
- dispatchEvent
- hasEventListener
- removeEventListener

## Methods

### `addEventListener`

(

- `type`
- `listener`

)
EventTarget

Defined in `src/utils/EventTarget.js:15`

Add an event listener

#### Parameters:

- `type` String
- `listener` Function

#### Returns:

EventTarget:

The self object, for chainability.

### `dispatchEvent`

(

- `event`

)
EventTarget

Defined in `src/utils/EventTarget.js:68`

Emit an event.

#### Parameters:

- `event` Object
  - `type` String

#### Returns:

EventTarget:

The self object, for chainability.

### `hasEventListener`

(

- `type`
- `listener`

)
Boolean

Defined in `src/utils/EventTarget.js:34`

Check if an event listener is added

#### Parameters:

- `type` String
- `listener` Function

#### Returns:

Boolean:

### `removeEventListener`

(

- `type`
- `listener`

)
EventTarget

Defined in `src/utils/EventTarget.js:50`

Remove an event listener

#### Parameters:

- `type` String
- `listener` Function

#### Returns:

EventTarget:

The self object, for chainability.