Home Reference Source
import EventListener from 'keasy/src/eventlistener.js'
public class | source

EventListener

Class which functions as a wrapper which holds a defined listener Function. This is done to ensure that when a listener Function is to be removed from and EventTarget the reference is the same as when it was added.

Constructor Summary

Public Constructor
public

constructor(type: String, executor: *)

Method Summary

Public Methods
public

addTo(target: EventTarget)

Binds the defined event-type and executor Function to the target.

public

Removes the defined event-type and executor Function to the target.

Public Constructors

public constructor(type: String, executor: *) source

Params:

NameTypeAttributeDescription
type String

The type {String} to

executor *

Public Methods

public addTo(target: EventTarget) source

Binds the defined event-type and executor Function to the target.

Params:

NameTypeAttributeDescription
target EventTarget

EventTarget which should be listened to.

public removeFrom(target: EventTarget) source

Removes the defined event-type and executor Function to the target.

Params:

NameTypeAttributeDescription
target EventTarget

EventTarget which should be listened to.