Skip to content

Instantly share code, notes, and snippets.

@AxGord
Created May 29, 2014 20:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AxGord/d9cd055a683290132a1a to your computer and use it in GitHub Desktop.
Save AxGord/d9cd055a683290132a1a to your computer and use it in GitHub Desktop.
Pony + Bindx, coming soon.
class Example
{
static function main()
{
var t = new Tumbler();
t.onEnable << function() trace('enable');
t.onDisable << function() trace('disable');
t.enabled = true;
t.enabled = false;
}
}
import bindx.IBindable;
import pony.events.Signal0;
class Tumbler implements IBindable
{
@:bindable
public var enabled:Bool;
public var onEnable:Signal0<Void>;
public var onDisable:Signal0<Void>;
public function new() {
onEnable = enabledChanged.sub(true);
onDisable = enabledChanged.sub(false);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment