new notify()
- Copyright:
- (c) Copyright 2013 - 2016 AV Digital Media Ltd. All Rights Reserved. No unauthorized copying, distribution or modification to this code in whole or in part is permitted without the express permission of AV Digital Media Ltd (UK).
This is the main command for the mvc framework, that which all other commands extend
Methods
(protected, static) destroy()
Loops through and executes the destroy method on all objects and then nullifies the objects and registered item references so that they can be garbage collected
(protected, static) dispatch(name, evnt, callback)
Dispatch an event to all registered objects for a specified event
Parameters:
Name | Type | Description |
---|---|---|
name |
String | Name of the object to register |
evnt |
String | The event string name |
callback |
function | The callback function for the event |
(protected, static) eachNotifier(notifyObjs, callback)
Simple loop through each notification object similar to the method in the dispatcher, but this object cannot access the dispatcher
Parameters:
Name | Type | Description |
---|---|---|
notifyObjs |
Object | The Object literal with the notification object references |
callback |
function | The callback function to execute on the object |
(protected, static) execute(name, data, type)
Execute a command of a given type with the data supplied
Parameters:
Name | Type | Description |
---|---|---|
name |
Object | The name or object reference to find |
data |
String | The event string name |
type |
function | The type of object caller |
(protected, static) getInstances(object)
Get the list of instances for a specified object type
Parameters:
Name | Type | Description |
---|---|---|
object |
Object | The object type to retrieve |
Returns:
This will return an array with the object instances
(protected, static) getObject(object)
Get an objects key instance
Parameters:
Name | Type | Description |
---|---|---|
object |
Object | The object type to retrieve |
Returns:
This will return the object found in any or undefined
(protected, static) injections(instance)
Check the injectables, objects that are required for direct injection into another object for quick reference
Parameters:
Name | Type | Description |
---|---|---|
instance |
Object | The instance to check the injections against |
(protected, static) length()
Get the length of the objects object
Returns:
The length of the object
(protected, static) list()
Return the object list as an array
Returns:
The array of objects
(protected, static) names()
Get the names of all saved objects
Returns:
The names array list
(protected, static) register(evnt, callback, instanceName)
Register and event for an object
Parameters:
Name | Type | Description |
---|---|---|
evnt |
String | The event string name |
callback |
function | The callback function for the event |
instanceName |
String | Name of the object to register |
Returns:
This will return a boolean to state if the registration occured
(protected, static) registrations(name)
Get the object registrations
Parameters:
Name | Type | Description |
---|---|---|
name |
String | Name of the object to register |
Returns:
The JSON list of events
(protected, static) remove({Object})
Remove an object reference
Parameters:
Name | Type | Description |
---|---|---|
{Object} |
String | object - The object to remove either a string NAME reference or the Object Class type |
(protected, static) store(instance, notifyObjs)
Store an Object reference
Parameters:
Name | Type | Description |
---|---|---|
instance |
Object | The object instance to store the reference of |
notifyObjs |
Object | The notification object reference, needed for the injection mapping across modules |
Returns:
This will return a boolean to state whether the storage occured
(protected, static) unregister({Boolean}, {String}, instanceName)
Remove an event registration
Parameters:
Name | Type | Description |
---|---|---|
{Boolean} |
String | evnt/doAll - The event string name |
{String} |
function | callback/instanceName - The callback function for the event |
instanceName |
String | Name of the object to unregister |
(protected, static) unregisterAll(name)
Clean all event registrations for an object
Parameters:
Name | Type | Description |
---|---|---|
name |
Object | The object name reference |