# Class CEvent<T>

Single event listener/emitter, listen to, and trigger events. (for mapped events use CMappedEvent).

#### Example

    const evt = new CEvent<bool>();
    evt.listen(listener);
    evt.dispatch(true);
    evt.remove(listener);

#### Type Parameters

- #### T

#### Hierarchy

- CEvent

- Defined in events.ts:14

#####
Index

### Constructors

constructor

### Properties

_listeners

### Methods

destroy
dispatch
listen
remove

## Constructors

### constructor

- new CEvent<T>(): CEvent<T>

- #### Type Parameters

  - #### T

  #### Returns CEvent<T>

## Properties

### `Protected` _listeners

_listeners: ((data) => void)[] = []

#### Type declaration

- - (data): void

  - #### Parameters

    - ##### data: undefined | T

    #### Returns void

- Defined in events.ts:15

## Methods

### destroy

- destroy(): void

- #### Returns void

  - Defined in events.ts:30

### dispatch

- dispatch(data?): void

- #### Parameters

  - ##### `Optional` data: T

  #### Returns void

  - Defined in events.ts:26

### listen

- listen(fn): void

- #### Parameters

  - ##### fn: ((data?) => void)

    - - (data?): void

      - #### Parameters

        - ##### `Optional` data: T

        #### Returns void

  - Defined in events.ts:17

### remove

- remove(fn): void

- #### Parameters

  - ##### fn: ((data?) => void)

    - - (data?): void

      - #### Parameters

        - ##### `Optional` data: T

        #### Returns void

  - Defined in events.ts:21

Generated using TypeDoc