Adventure.js Docs Downloads
Score: 0 Moves: 0

Class: Reactor

Defined in: adventure/Reactor.js, line 6

Framework class

Reactor manages event listening for custom events, by creating a DOM element to do the listening, and then hooking into the element's DOM methods. Reactor is created automatically by Game. This is an internal class that authors should not need to construct or modify.

Private Constructor:

var foo = new adventurejs.Reactor(game)

Parameters:

  • game Game
    A reference to the game instance.
Inherited Overrides
IndexMethodsProperties

Methods Collapse all  |  Expand all

Properties Collapse all  |  Expand all

addEventListener :Object

Defined in: adventure/Reactor.js, line 49

Default value: {}

Hook game.reactor to target.addEventListener.
dispatchEvent :Object

Defined in: adventure/Reactor.js, line 63

Default value: {}

Hook game.reactor to target.dispatchEvent.
game :Object

Defined in: adventure/Reactor.js, line 27

Default value: {}

A reference back to the main Game object.
removeEventListener :Object

Defined in: adventure/Reactor.js, line 56

Default value: {}

Hook game.reactor to target.removeEventListener.
target :HTMLElement

Defined in: adventure/Reactor.js, line 34

Default value: {}

Create a text node / HTML element to act as a listener for custom events.
Documentation generated by JSDoc 3.6.11 on Mon Nov 20 2023 18:02:26 GMT-0800 (Pacific Standard Time)
Found a problem or error in the docs? Report it to docs@adventurejs.com.