Skip to content

Commit

Permalink
Merge pull request #8 from halotukozak/halotukozak-patch-1
Browse files Browse the repository at this point in the history
add mix function to Flow Utils
  • Loading branch information
halotukozak authored Jan 17, 2024
2 parents 33913c4 + 14d4ab5 commit 1532fc8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/kotlin/shared/FlowUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@ fun <K, V> Flow<Pair<K, V>>.group(): Flow<Pair<K, List<V>>> = flow {//todo idk i
storage.forEach { (k, ts) -> emit(k to ts) }
}

inline fun <reified T> mix(vararg flows: Flow<T>): Flow<Array<T>> = combine(*flows) { it }

val Flow<Boolean>.not
get() = map { !it }
get() = map { !it }

0 comments on commit 1532fc8

Please sign in to comment.