Skip to content

Instantly share code, notes, and snippets.

@FokkeZB
FokkeZB / app.js
Last active August 29, 2015 14:06
addEventListenerOnce
var win = Ti.UI.createWindow({
backgroundColor: 'white'
});
win.addEventListener('click', function foo(e) { // note the named function expression needed for the second way
// oringal idea by @fukhaos
// http://www.tidev.io/2014/09/10/the-case-against-ti-app-fireevent-2/#comment-13013
e.source.removeEventListener(e.type, arguments.callee);