Skip to content

Instantly share code, notes, and snippets.

@richardszalay
Created March 26, 2011 19:18
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save richardszalay/888554 to your computer and use it in GitHub Desktop.
Basic raix.reactive example
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