Run icon indicating copy to clipboard operation
Run copied to clipboard

利用Kotlin和协程实现DSL样式的网络请求

Results 2 Run issues
Sort by recently updated
recently updated
newest added

场景一个界面有3个网络请求, 默认先进行进度条, 然后并发执行3个网络请求, 在最耗时的网络请求完事, 隐藏进度条.

apiDSL方法中为什么要重复多次创建`ViewModelDsl()`对象呢?抽离出来不更好吗? ```kotlin protected fun apiDSL(apiDSL: ViewModelDsl.() -> Unit) { val s: ViewModelDsl = ViewModelDsl().apply(apiDSL) api { onRequest { s.request() } onResponse { s.onResponse?.invoke(it) } onStart { val override = s.onStart?.invoke()...