Class vxlNotifier

Hub for the publish-subscribe mechanism among Voxelent entities

Constructor

vxlNotifier()

Handles asynchronous communication among classes in Voxelent using a publisher-subscriber mechanism

Methods

.fire(event, src)

Invoked by any class when it needs to emit an event that should be propagated to otherobjects in the library

The notifier will first verify if the object emitting the event has been authorized to do so.This is, the object should have registered using publish.After that, the notifier will retrieve a list of the objects that have registered as listeners of the particular event and fires the event to them using JQuery.

Parameters:

Type Name Description
Object event

Object src

.getEvents()
Gets a list of the events handled by this vxlNotifier
.getTargetsFor(event)
Get a list of the objects that are currently registered to listen for a particular event

Parameters:

Type Name Description
Object event

the event in question

.publish(list, sender)

Used by any class to declare the events that the class will generate

Parameters:

Type Name Description
Object list

Object sender

.subscribe(list, receiver)

Used by any class to declare the events that the class will listen for.

Parameters:

Type Name Description
Object list

Object receiver