Created
May 29, 2014 20:17
-
-
Save AxGord/d9cd055a683290132a1a to your computer and use it in GitHub Desktop.
Pony + Bindx, coming soon.
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
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; | |
} | |
} |
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
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