Skip to content

Commit

Permalink
update method
Browse files Browse the repository at this point in the history
  • Loading branch information
KunMinX committed Jun 25, 2023
1 parent c27a0b2 commit 7995ad5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ MVI-Dispatcher 应运而生。
在本案例中,我将为您展示,MVI-Dispatcher 是如何将原本 "繁杂易出错" 消息分发流程,通过 **寥寥几行代码** 轻而易举完成。

```Groovy
implementation 'com.kunminx.arch:mvi-dispatch-ktx:7.2.0'
implementation 'com.kunminx.arch:mvi-dispatch-ktx:7.3.0'
```

 
Expand Down Expand Up @@ -94,7 +94,7 @@ MVI-Dispatcher 应运而生,

# Thanks to

感谢小伙伴苏旗的测试反馈和协助排查
感谢小伙伴苏旗、YJH 的测试反馈

[AndroidX](https://developer.android.google.cn/jetpack/androidx)

Expand Down
2 changes: 1 addition & 1 deletion README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ The author has long focused on the "business architecture" pattern and is commit
In this case, I will show you how MVI-Dispatcher can easily accomplish the previously complicated and error-prone message distribution process with just a few lines of code.

```Groovy
implementation 'com.kunminx.arch:mvi-dispatch-ktx:7.2.0'
implementation 'com.kunminx.arch:mvi-dispatch-ktx:7.3.0'
```

 
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ buildscript {
ext {
appTargetSdk = 32
appMinSdk = 15
appVersionCode = 702000
appVersionName = "7.2.0"
appVersionCode = 703000
appVersionName = "7.3.0"
room_version = '2.4.3'
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ open class MviDispatcherKTX<T : Any> : ViewModel(), DefaultLifecycleObserver {
}

fun output(activity: AppCompatActivity?, observer: (T) -> Unit) {
output(activity, observer)
outputTo(activity, observer)
}

fun output(fragment: Fragment?, observer: (T) -> Unit) {
output(fragment?.viewLifecycleOwner, observer)
outputTo(fragment?.viewLifecycleOwner, observer)
}

private fun output(lifecycleOwner: LifecycleOwner?, observer: (T) -> Unit) {
private fun outputTo(lifecycleOwner: LifecycleOwner?, observer: (T) -> Unit) {
currentVersion = version
observerCount++
lifecycleOwner?.lifecycle?.addObserver(this)
Expand Down

0 comments on commit 7995ad5

Please sign in to comment.