2.4.0 release
This commit is contained in:
@@ -60,6 +60,7 @@ Bind.bind(expr, listener) | executes `listener` if property or method in `expr`
|
|||||||
Bind.bindTo(expr, toExpr) | Assign result of `expr` to `toExpr` (NB: if `expr` contains method, then this method will be executed without arguments!). Does NOT invoke `expr` automatically.
|
Bind.bindTo(expr, toExpr) | Assign result of `expr` to `toExpr` (NB: if `expr` contains method, then this method will be executed without arguments!). Does NOT invoke `expr` automatically.
|
||||||
Bind.notify(expr, oldValue, newValue) | Manually execute notification about property or method changes (if `expr` is method, then `oldValue` and `newValue` are not required)
|
Bind.notify(expr, oldValue, newValue) | Manually execute notification about property or method changes (if `expr` is method, then `oldValue` and `newValue` are not required)
|
||||||
Bind.unbind(expr, listener) | Unsubscribe provided `listener` from `expr` changes (NB: if `listener` is not specified, all listeners for binded to this `expr` will be unsubscribed)
|
Bind.unbind(expr, listener) | Unsubscribe provided `listener` from `expr` changes (NB: if `listener` is not specified, all listeners for binded to this `expr` will be unsubscribed)
|
||||||
|
Bind.bindAll(obj:IBindable, listener, force) | Bind all properties and methods of `obj` (force mode instantiate all lazy signals). Return unbind callback
|
||||||
Bind.unbindAll(obj:IBindable) | Unbind all properties and methods of `obj` (NB: still can bind new listeners after that!)
|
Bind.unbindAll(obj:IBindable) | Unbind all properties and methods of `obj` (NB: still can bind new listeners after that!)
|
||||||
|
|
||||||
## Extended API:
|
## Extended API:
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ Bind.bind(expr, listener) | `listener` вызывается при смене с
|
|||||||
Bind.bindTo(expr, toExpr) | Присваивает значение `expr` выражению `toExpr` (NB: в случае метода вызывает метод без параметров!). Автоматически первый вызов НЕ происходит
|
Bind.bindTo(expr, toExpr) | Присваивает значение `expr` выражению `toExpr` (NB: в случае метода вызывает метод без параметров!). Автоматически первый вызов НЕ происходит
|
||||||
Bind.notify(expr, oldValue, newValue) | Ручной вызов оповещения об изменении свойства или метода (в случае метода ожидается только один аргумент в методе `notiry`)
|
Bind.notify(expr, oldValue, newValue) | Ручной вызов оповещения об изменении свойства или метода (в случае метода ожидается только один аргумент в методе `notiry`)
|
||||||
Bind.unbind(expr, listener) | Удаляется подписка на изменения свойства (NB: если `listener` не указать, произойдет полная отписка всех слушателей!)
|
Bind.unbind(expr, listener) | Удаляется подписка на изменения свойства (NB: если `listener` не указать, произойдет полная отписка всех слушателей!)
|
||||||
|
Bind.bindAll(obj:IBindable, listener, force) | Подписывается на изменения всех свойств и методов `obj` (force режим создаст все лениво создаваемые сигналы). Вернет колбек для отписки
|
||||||
Bind.unbindAll(obj:IBindable) | Удаляются все подписки на изменения всех свойств и методов объекта (NB: дальнейшая подписка доступна!)
|
Bind.unbindAll(obj:IBindable) | Удаляются все подписки на изменения всех свойств и методов объекта (NB: дальнейшая подписка доступна!)
|
||||||
|
|
||||||
## Расширенное API:
|
## Расширенное API:
|
||||||
|
|||||||
+2
-2
@@ -5,8 +5,8 @@
|
|||||||
"tags": ["bind", "binding", "bindings", "cross"],
|
"tags": ["bind", "binding", "bindings", "cross"],
|
||||||
"description": "Powerful and fast macro-based data binding engine inspired by Flex Bindings with easy-to-use syntax.",
|
"description": "Powerful and fast macro-based data binding engine inspired by Flex Bindings with easy-to-use syntax.",
|
||||||
"classPath": "src",
|
"classPath": "src",
|
||||||
"version": "2.3.0",
|
"version": "2.4.0",
|
||||||
"releasenote": "typedefs support",
|
"releasenote": "bindAll method",
|
||||||
"contributors": [
|
"contributors": [
|
||||||
"deep"
|
"deep"
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -118,12 +118,10 @@ class SignalTools {
|
|||||||
var data = std.Reflect.field(meta, m);
|
var data = std.Reflect.field(meta, m);
|
||||||
if (std.Reflect.hasField(data, BIND_SIGNAL_META)) {
|
if (std.Reflect.hasField(data, BIND_SIGNAL_META)) {
|
||||||
var signal:bindx.BindSignal.Signal<Dynamic> = cast std.Reflect.field(bindable, m);
|
var signal:bindx.BindSignal.Signal<Dynamic> = cast std.Reflect.field(bindable, m);
|
||||||
trace(signal);
|
|
||||||
if (signal == null && force) {
|
if (signal == null && force) {
|
||||||
var args:Array<Dynamic> = std.Reflect.field(data, BIND_SIGNAL_META);
|
var args:Array<Dynamic> = std.Reflect.field(data, BIND_SIGNAL_META);
|
||||||
var lazy:Bool = args[0];
|
var lazy:Bool = args[0];
|
||||||
if (lazy) signal = cast std.Reflect.getProperty(bindable, m.substr(1));
|
if (lazy) signal = cast std.Reflect.getProperty(bindable, m.substr(1));
|
||||||
trace(signal);
|
|
||||||
}
|
}
|
||||||
if (signal != null) signals.push(signal);
|
if (signal != null) signals.push(signal);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user