Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
mykola-dev committed Oct 24, 2017
1 parent 3dc2b6c commit ee5d7ae
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,17 @@ class MainViewModel : Bindable {
```
and Activity:
```kotlin
private fun bindViews() = with(viewModel) {
private fun bindViews() = withBindable(viewModel) {
bind(::text, textLabel::setText, textLabel::getText)
}
```
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)
}
```
Expand Down

0 comments on commit ee5d7ae

Please sign in to comment.