Tone.Emitter

↳ EXTENDS Tone

Tone.Emitter gives classes which extend it the ability to listen for and emit events. Inspiration and reference from Jerome Etienne’s MicroEvent. MIT (c) 2011 Jerome Etienne.

CONSTRUCTOR

new Tone.Emitter ( )

Methods

.dispose ( )

#
↪ returns Tone.Emitter

this

Clean up

</>

.emit ( )

#
event

The name of the event.

type: String
args...

The arguments to pass to the functions listening.

type: *
↪ returns Tone.Emitter

this

Invoke all of the callbacks bound to the event with any arguments passed in.

</>

.off ( )

#
event

The event to stop listening to.

type: String
callback

The callback which was bound to the event with Tone.Emitter.on. If no callback is given, all callbacks events are removed.

type: function
optional
↪ returns Tone.Emitter

this

Remove the event listener.

</>

.on ( )

#
event

The name of the event to listen for.

type: String
callback

The callback to invoke when the event is emitted

type: function
↪ returns Tone.Emitter

this

Bind a callback to a specific event.

</>

.once ( )

#
event

The name of the event to listen for.

type: String
callback

The callback to invoke when the event is emitted

type: function
↪ returns Tone.Emitter

this

Bind a callback which is only invoked once

</>

Static Methods

.mixin ( )

#
object

The object or class to extend.

type: Object or function
↪ returns Tone.Emitter

Add Emitter functions (on/off/emit) to the object

</>
docs generated Sep 15 2019