#

API Docs for: 3.10.3
Show: Inherited Protected Private Deprecated

# Test.EventTarget Class

Defined in: `test/js/EventTarget.js:2`
Module: test

Simple custom event implementation.

- Index
- Methods
- Properties

## Item Index

### Methods

- attach
- detach
- fire
- subscribe deprecated
- unsubscribe deprecated

### Properties

- _handlers static

## Methods

### `attach`

(

- `type`
- `listener`

)
Void

Defined in `test/js/EventTarget.js:31`

Adds a listener for a given event type.

#### Parameters:

- `type` String

  The type of event to add a listener for.

- `listener` Function

  The function to call when the event occurs.

#### Returns:

Void:

### `detach`

(

- `type`
- `listener`

)
Void

Defined in `test/js/EventTarget.js:85`

Removes a listener for a given event type.

#### Parameters:

- `type` String

  The type of event to remove a listener from.

- `listener` Function

  The function to remove from the event.

#### Returns:

Void:

### `fire`

(

- `event`

)
Void

Defined in `test/js/EventTarget.js:58`

Fires an event based on the passed-in object.

#### Parameters:

- `event` Object | String

  An object with at least a 'type' attribute or a string indicating the event name.

#### Returns:

Void:

### `subscribe`

(

- `type`
- `listener`

)
Void deprecated

Defined in `test/js/EventTarget.js:46`

Adds a listener for a given event type.

#### Parameters:

- `type` String

  The type of event to add a listener for.

- `listener` Function

  The function to call when the event occurs.

#### Returns:

Void:

### `unsubscribe`

(

- `type`
- `listener`

)
Void deprecated

Defined in `test/js/EventTarget.js:104`

Removes a listener for a given event type.

#### Parameters:

- `type` String

  The type of event to remove a listener from.

- `listener` Function

  The function to remove from the event.

#### Returns:

Void:

## Properties

### `_handlers`

Object private static

Defined in `test/js/EventTarget.js:11`

Event handlers for the various events.