Skip to content

Module: core::EventTarget

Jovan Gerodetti edited this page Apr 14, 2021 · 4 revisions

EventTarget

exported: default
kind: object
declaration: const

Properties

🚫 _listeners

Type: object
kind: value

Methods

constructor() => {EventTarget}

kind: function

_make(args) => {this}

kind: function

Do not use the make constructors

Name Type Description
args ...*

on(type, listener) => {undefined}

kind: function

registers a new listener for the given event

Name Type Description
type string the type / name of event
listener Function callback to execute when the event fires

emit(type, data) => {undefined}

kind: function

emmits a new event on this object

Name Type Description
type string the type of event
data * data to send to the callbacks

removeListener(type, listener) => {undefined}

kind: function

removes a previously attached listener function.

Name Type Description
type string the listener type
listener Function the listener function to remove

Clone this wiki locally