Add hook: requestFinished

Called after each request finished. Argument is {success: boolean} indicated the request success or fail.
This commit is contained in:
Xelio
2013-03-05 03:17:46 +08:00
parent 45bed379ec
commit eb3ec79852
2 changed files with 5 additions and 2 deletions

View File

@ -46,14 +46,15 @@
// checkRenderLimit: callback is passed the argument of
// {reached : false} to indicate that the renderlimit is reached
// set reached to true.
// requestFinished: called after each request finished. Argument is
// {success: boolean} indicated the request success or fail.
window._hooks = {}
window.VALID_HOOKS = ['portalAdded', 'portalDetailsUpdated',
'publicChatDataAvailable', 'portalDataLoaded', 'beforePortalReRender',
'checkRenderLimit'];
'checkRenderLimit', 'requestFinished'];
window.runHooks = function(event, data) {
if(VALID_HOOKS.indexOf(event) === -1) throw('Unknown event type: ' + event);