# interface ISimpleEventCollection<T, R>

#### package com.turner.top.lib.events.collection

#### extended by IEventCollection

A simple collection of events. Allows for listening to some or all the events in the collection.

See:

Integration - Init Config Collection
Integration - Player Collection

### Methods

###

`each (f:EventSignal1<T, R> ‑> Void):ISimpleEventCollection<T, R>`

Iterate over each event signal in the list

Parameters:

`f` | The callback function to trigger for each event signal in the collection

###

`length ():UInt`

The number of events in the collection

###

`listen (handler:ListenableHandler):ISimpleEventCollection<T, R>`

Listen to all or specific events

Parameters:

`handler` | If a callback function is provided, will trigger if any event is dispatched If a map is provided, event handlers will be added for the specified events

###

`listenFor (f:ListenForMap):ISimpleEventCollection<T, R>`

Deprecated:

Since verion `1.2.0` in favor of `listen`

Add an event handler for event types defined on the passed in map

Parameters:

`f` | A map defining callbacks to trigger

###

`once (handler:ListenableHandler):ISimpleEventCollection<T, R>`

Listen to all or specific events, once. The given handler(s) will be automatically unregistered upon first invocation

Parameters:

`handler` | If a callback function is provided, will triggy if any event is dispatched If a map is provided, event handlers will be added for the specified events

###

`unlisten (handler:ListenableHandler):ISimpleEventCollection<T, R>`

Discontinue listening of all or specific events

Parameters:

`handler` | If a callback function is provided, the function will no longer be invoked when any event is dispatched If a map is provided, event handlers will be removed for the specified events.

###

`unlistenFor (f:ListenForMap):ISimpleEventCollection<T, R>`

Deprecated:

Since verion `1.2.0` in favor of `unlisten`

Remove an event handler for event types defined on the passed in map

Parameters:

`f` | A map defining callbacks to discontinue triggering