Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/threejs_4_deno/src/core/EventDispatcher.d.ts>EventDispatcher

A simple transformation of three.js for use within a Deno workflow
Go to Latest
class EventDispatcher
import { EventDispatcher } from "https://deno.land/x/threejs_4_deno@v121/src/core/EventDispatcher.d.ts";

JavaScript events for custom objects

Constructors

new
EventDispatcher()

Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Methods

addEventListener(type: string, listener: (event: Event) => void): void

Adds a listener to an event type.

dispatchEvent(event: { [attachment: string]: any; type: string; }): void

Fire an event type.

hasEventListener(type: string, listener: (event: Event) => void): boolean

Checks if listener is added to an event type.

removeEventListener(type: string, listener: (event: Event) => void): void

Removes a listener from an event type.