Skip to content

Commit

Permalink
Change unbind syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
AChep committed Feb 27, 2021
1 parent 31da572 commit c983dff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion library/src/main/java/com/artemchep/bindin/BindIn.kt
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ private inline fun <T> LifecycleOwner._bindIn(
)
return InBinding(
data = inBindingData,
registration = registration,
unbind = registration,
)
}

Expand Down
6 changes: 2 additions & 4 deletions library/src/main/java/com/artemchep/bindin/Model.kt
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package com.artemchep.bindin

private typealias Registration = () -> Unit

class InBinding<T>(
val data: InBindingData<T>,
private val registration: Registration,
) : Registration by registration
val unbind: () -> Unit,
)

class InBindingData<T> {
var outValue: Any? = Any()
Expand Down

0 comments on commit c983dff

Please sign in to comment.