Skip to content

Instantly share code, notes, and snippets.

View krawaller's full-sized avatar

David Waller krawaller

View GitHub Profile
$('<div/>').attachAndReturn(Letter, this, letter, specialLetter);
var Test = {
name: 'test',
init: function(){
this.proxiedHandleEvents = $.proxy(this.handleEvents, this);
Ti.App.addEventListener('app', this.proxiedHandleEvents);
},
// Event cannon with callback fix.
fire: function(opts){
// Demo usage of http://github.com/krawaller/PubSubHotTub
var func = function(){ console.log(Array.prototype.slice.call(arguments).join(" ")); };
pb.sub('/root/leaf/meatloaf', func, 'i', 'like', 'curry');
pb.pub('/root/leaf/meatloaf', 'and', 'cheese'); // => i like curry and cheese
pb.sub('/*/leaf/*', func);
pb.pub('/root/leaf/*', 'cheese'); // => cheese, i like curry cheese ^^ (curry cheese sounds rad)