Skip to content

Commit

Permalink
直接请求算了
Browse files Browse the repository at this point in the history
  • Loading branch information
Reginer committed Mar 19, 2020
1 parent c7d4422 commit 5b6e9c9
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 5 deletions.
15 changes: 15 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 35 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@ dependencies {
implementation(MvvmExt.objectboxAndroid)
implementation(MvvmExt.objectboxKotlin)
debugImplementation project(path: ':base')
releaseImplementation 'com.github.Reginer:MVVMHub:1.7'
releaseImplementation 'com.github.Reginer:MVVMHub:1.9.6'
}
14 changes: 14 additions & 0 deletions base/src/main/java/win/regin/base/ext/MvvmExt.kt
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,20 @@ fun <T> BaseViewModel.launchRequest(
}
}

/**
* net request
* @param request request method
*/
fun <T> BaseViewModel.launchRequestNoState(
request: suspend () -> BaseEntity<T>
) {
viewModelScope.launch {
runCatching {
request()
}
}
}


/**
* 以协程形式执行
Expand Down
8 changes: 4 additions & 4 deletions buildSrc/src/main/java/MvvmExt.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,24 @@ object AppConfig {

object Version {
const val gradleVersion = "3.5.2"
const val kotlinVersion = "1.3.60"
const val kotlinVersion = "1.3.70"
const val appcompatVersion = "1.1.0"
const val ktxVersion = "1.2.0-beta02"
const val constraintlayoutVersion = "2.0.0-beta3"
const val junitVersion = "4.12"
const val extUnitVersion = "1.1.0"
const val espressoVersion = "3.2.0"
const val lifecycleVersion = "2.2.0-rc02"
const val retrofitVersion = "2.6.2"
const val retrofitVersion = "2.7.2"
//http://jcenter.bintray.com/org/jetbrains/kotlinx/kotlinx-coroutines-android/
const val coroutinesVersion = "1.3.2"
//http://jcenter.bintray.com/com/squareup/okhttp3/logging-interceptor/
const val okhttp3LogVersion = "4.2.2"
const val materialVersion = "1.2.0-alpha01"
const val objectboxVersion = "2.4.1"
const val loggerVersion = "2.2.0"
const val libVersionCode = 14
const val libVersionName = "1.9.5"
const val libVersionCode = 15
const val libVersionName = "1.9.6"
}

object MvvmExt {
Expand Down

0 comments on commit 5b6e9c9

Please sign in to comment.