From ee5d7aee55d1c758b0182cce470ee6839cea755e Mon Sep 17 00:00:00 2001 From: deviant Date: Tue, 24 Oct 2017 14:48:58 +0300 Subject: [PATCH] update readme --- README.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index a28e125..33fb92e 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ class MainViewModel : Bindable { ``` and Activity: ```kotlin -private fun bindViews() = with(viewModel) { +private fun bindViews() = withBindable(viewModel) { bind(::text, textLabel::setText, textLabel::getText) } ``` @@ -76,13 +76,9 @@ Thats it! Now we can set TextView's text like: ```kotlin viewModel.sayHello() ``` -Don't forget to unbind viewModel to avoid leaks: -```kotlin -viewModel.unbindAll() -``` Also library allows you to simplify `TextView`/`EditText` bindings to this: ```kotlin -with(viewModel) { +withBindable(viewModel) { bind(::text, textLabel) } ```