Tone.Emitter
↳ EXTENDS ToneTone.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
.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.
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