Created
September 28, 2012 18:19
-
-
Save jameswomack/3801364 to your computer and use it in GitHub Desktop.
Call method when n events have fired
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Batman.Object::actOnListeners = (context, f, objectEventPairs...) -> | |
_satisfiedObjects = [] | |
for objectEventPair in objectEventPairs | |
objectEventPair[0].on objectEventPair[1], -> | |
_satisfiedObjects.add objectEventPair | |
f.apply theContext if objectEventPairs.exclude(_satisfiedObjects...).length is 0 | |
@actOnListeners @, @showArticle, [[Brilliant,'ready'],[@get('currentArticleView'),'ready']] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment