From 61c7b5643596de9314897ff594dececea14b6d54 Mon Sep 17 00:00:00 2001 From: Dima Granetchi Date: Sat, 1 Aug 2015 12:58:34 +0300 Subject: [PATCH] update readme (bindTo info) --- README.md | 8 ++++---- README_ru.md | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d1dd976..8a146e4 100644 --- a/README.md +++ b/README.md @@ -56,8 +56,8 @@ function onHealthChange(from:Null, to:Null) { Method | Description ------------ | ------------- -Bind.bind(expr, listener) | executes `listener` if property or method in `expr` was changed. If `expr` contains property, then `listener` accepts 2 arguments: old and new values. If `expr` contains method, `listener` accepts no arguments. -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.bind(expr, listener) | executes `listener` if property or method in `expr` was changed. If `expr` contains property, then `listener` accepts 2 arguments: old and new values. If `expr` contains method, `listener` accepts no arguments. Use `Bind.unbind` for unbind +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. Returns reference callback, which can be used to unbind. 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.bindAll(obj:IBindable, listener, force) | Bind all properties and methods of `obj` (force mode instantiate all lazy signals). Return unbind callback @@ -66,8 +66,8 @@ Bind.unbindAll(obj:IBindable) | `listener:String->Void` Unbind all properties an ## Extended API: Method | Description ------------- | ------------- -BindExt.chain(chainExpr, listener) | Subscribe to sequence of invokations like `a.b.c(1).d..`, fires signal if any member of `chainExpr` was changed (automatically unsubscribes from old value and subscribes to new one). Methods can be specified with arguments. (NB: for the first time `listener` will be called automatically). `listener` behaves identicaly to `listener` in Bind.bind(). BindExt.chain() returns reference callback, which can be used to completely unbind `chainExpr`. +------------ | -------------returns reference callback, which can be used to completely unbind +BindExt.chain(chainExpr, listener) | Subscribe to sequence of invokations like `a.b.c(1).d..`, fires signal if any member of `chainExpr` was changed (automatically unsubscribes from old value and subscribes to new one). Methods can be specified with arguments. (NB: for the first time `listener` will be called automatically). `listener` behaves identicaly to `listener` in Bind.bind(). `BindExt.chain()` `chainExpr`. BindExt.chainTo(chainExpr, toExpr) | Bind `chainExpr` to `toExpr`. (NB: for the first time binding is executed automatically). Returns a callback to unbind `chainExpr`. BindExt.expr(expr, listener) | Universal method. `expr` can be any valid Haxe expression. All `IBindable` instances and bindables properties will be found automatically. `listener` always accepts 2 arguments. Previous values automatically stored for methods. (NB: for the first time `listener` is called automatically). BindExt.expr() returns a callback to unbind `expr`. BindExt.exprTo(expr, toExpr) | Bind any valid `expr` to `toExpr`. (NB: for the first time `listener` is called automatically). Returns a callback to unbind `expr`. diff --git a/README_ru.md b/README_ru.md index 187ea9f..55d2da0 100644 --- a/README_ru.md +++ b/README_ru.md @@ -57,7 +57,7 @@ function onHealthChange(from:Null, to:Null) { Method | Description ------------ | ------------- Bind.bind(expr, listener) | `listener` вызывается при смене свойства или метода в `expr`. Слушатель свойства принимает 2 параметра, старое и новое значение свойства, метода - 0 параметров -Bind.bindTo(expr, toExpr) | Присваивает значение `expr` выражению `toExpr` (NB: в случае метода вызывает метод без параметров!). Автоматически первый вызов НЕ происходит +Bind.bindTo(expr, toExpr) | Присваивает значение `expr` выражению `toExpr` (NB: в случае метода вызывает метод без параметров!). Автоматически первый вызов НЕ происходит. Метод возвращает ссылку на функцию, позволяющую отписаться. Bind.notify(expr, oldValue, newValue) | Ручной вызов оповещения об изменении свойства или метода (в случае метода ожидается только один аргумент в методе `notiry`) Bind.unbind(expr, listener) | Удаляется подписка на изменения свойства (NB: если `listener` не указать, произойдет полная отписка всех слушателей!) Bind.bindAll(obj:IBindable, listener, force) | `listener:String->Void` Подписывается на изменения всех свойств и методов `obj` (force режим создаст все лениво создаваемые сигналы). Вернет колбек для отписки