I'm wondering is it possible for force a javascript event listener to, without the condition being true force it to execute once then continue listening for it's condition to be met to execute further?
var clickFunction = function (event) {
//do some stuff here
window.removeEventListener('click',clickFunction, false );
};
window.addEventListener("click", clickFunction, false);
This will let you fire the clickFunction once, as the magic of closure let the removeEventListener find the clickFunction.
No need to use a library just to get something simple done.