Created
March 26, 2011 19:18
-
-
Save richardszalay/888554 to your computer and use it in GitHub Desktop.
Basic raix.reactive example
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
var doubleClicks : IObservable = Observable.fromEvent(stage, MouseEvent.CLICK) | |
.timeInterval() | |
.filter(function(ti:TimeInterval):Boolean { return ti.interval < 300; }) | |
.removeTimeInterval(); | |
var subscription : ICancelable = doubleClicks.subscribe(function(me:MouseEvent):void | |
{ | |
trace("Double click"); | |
}); | |
// Unsubscribe (removing all event listeners) | |
subscription.cancel(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment