ResponseService
Description
Twigkit service for setting and getting responses.
Methods
clearResponses()
Removes all responses from the factory.
Example
ResponseService.clearResponses();
createResponseFromResults(results)
getResponse(name, keys)
Gets response from the factory.
Parameters
Param Type Details name string The name of the response to retrieve
keys (optional)string A comma separated list of keys you would like returned. If null whole response will be returned.
Returns
Object Returns the response object from the factory, if it doesn't exist it will return
null
Example
ResponseService.getResponse(name);
setResponse(name, value)
Adds response to response factory for retrieval using the getResponse method. Broadcasts an event of 'responsename_updated' with the new response value.
Parameters
Param Type Details name string The name of the response
value Object The response object to add to the factory.
Example
ResponseService.setResponse(name, value);