Created
June 22, 2012 21:01
-
-
Save zz85/2975176 to your computer and use it in GitHub Desktop.
Example for SimpleEvent component from http://jsdo.it/zz85/75cq
This file contains 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
// generates a "event channel" | |
var onFire = new SimpleEvent(); | |
// adds an listener | |
onFire.add(function aListener(hello, world){ | |
alert(hello + ' ' + world); | |
}) | |
// notifies listeners | |
onFire.notify('Bye', 'Universe'); | |
// unregister listener | |
onFire.remove(aListener); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment