Skip to content

Commit

Permalink
Merge pull request #91 from hoc081098/renovate/com.vanniktech.maven.p…
Browse files Browse the repository at this point in the history
…ublish-0.x

chore(deps): update plugin com.vanniktech.maven.publish to v0.20.0
  • Loading branch information
hoc081098 committed Jun 4, 2022
2 parents d810829 + d297936 commit da78934
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
12 changes: 8 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import com.vanniktech.maven.publish.MavenPublishBaseExtension
import com.vanniktech.maven.publish.MavenPublishBasePlugin
import com.vanniktech.maven.publish.SonatypeHost
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.jetbrains.dokka.gradle.DokkaTask
Expand All @@ -9,7 +12,7 @@ plugins {
kotlin("multiplatform") version "1.6.21"
id("com.diffplug.spotless") version "6.6.1"
id("maven-publish")
id("com.vanniktech.maven.publish") version "0.19.0"
id("com.vanniktech.maven.publish") version "0.20.0"
id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.10.0"
id("org.jetbrains.dokka") version "1.6.21"
id("org.jetbrains.kotlinx.kover") version "0.5.1"
Expand Down Expand Up @@ -188,9 +191,10 @@ spotless {
}

allprojects {
plugins.withId("com.vanniktech.maven.publish") {
mavenPublish {
sonatypeHost = com.vanniktech.maven.publish.SonatypeHost.S01
plugins.withType<MavenPublishBasePlugin> {
extensions.configure<MavenPublishBaseExtension> {
publishToMavenCentral(SonatypeHost.S01)
signAllPublications()
}
}
}
Expand Down
15 changes: 15 additions & 0 deletions src/commonMain/kotlin/com/hoc081098/flowext/defer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,20 @@ import kotlinx.coroutines.flow.flow
*
* In some circumstances, waiting until the last minute (that is, until collection time)
* to generate the [Flow] can ensure that collectors receive the freshest data.
*
* Example of usage:
*
* ```
* suspend fun remoteCall1(): R1 = ...
* suspend fun remoteCall2(r1: R1): R2 = ...
*
* fun example1(): Flow<R2> = defer {
* val r1 = remoteCall1()
* val r2 = remoteCall2(r1)
* flowOf(r2)
* }
*
* fun example2(): Flow<R1> = defer { flowOf(remoteCall1()) }
* ```
*/
public fun <T> defer(flowFactory: suspend () -> Flow<T>): Flow<T> = flow { emitAll(flowFactory()) }

0 comments on commit da78934

Please sign in to comment.