Expanding on the previous posts: I have created a function that you can call to perform this "hooking" action.
hookFunction(UIIntentionalStream.instance, 'loadOlderPosts', function(){
/* This anonymous function gets called after UIIntentionalStream.instance.loadOlderPosts() has finished */
doMyCustomStuff();
});
// Define this function so you can reuse it later and keep your overrides "cleaner"
function hookFunction(object, functionName, callback) {
(function(originalFunction) {
object[functionName] = function () {
var returnValue = originalFunction.apply(this, arguments);
callback.apply(this, [returnValue, originalFunction, arguments]);
return returnValue;
};
}(object[functionName]));
}
Bonus: You should also wrap this all a closure, for good measure.