diff --git a/src/bindx/BindxExt.hx b/src/bindx/BindxExt.hx index ffe5df5..e8dd3bc 100644 --- a/src/bindx/BindxExt.hx +++ b/src/bindx/BindxExt.hx @@ -35,10 +35,20 @@ class BindExt { return internalBindExpr(expr, listener); } + @:noUsing macro static public function exprTo(expr:Expr, target:Expr):Expr { + var type = Context.typeof(expr).toComplexType(); + return internalBindExpr(expr, macro function (_, to:Null<$type>) $target = to); + } + @:noUsing macro static public function chain(expr:Expr, listener:Expr):Expr { return internalBindChain(expr, listener); } + @:noUsing macro static public function chainTo(expr:Expr, target:Expr):Expr { + var type = Context.typeof(expr).toComplexType(); + return internalBindChain(expr, macro function (_, to:Null<$type>) $target = to); + } + #if macro public static function internalBindChain(expr:Expr, listener:Expr):Expr {