๐
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import androidx.compose.animation.AnimatedContent | |
import androidx.compose.animation.ExperimentalAnimationApi | |
import androidx.compose.animation.animateColorAsState | |
import androidx.compose.animation.core.animateDpAsState | |
import androidx.compose.animation.fadeIn | |
import androidx.compose.animation.fadeOut | |
import androidx.compose.animation.togetherWith | |
import androidx.compose.foundation.Canvas | |
import androidx.compose.foundation.background | |
import androidx.compose.foundation.layout.Arrangement |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension Publisher { | |
// The flatMapLatest operator behaves much like the standard FlatMap operator, except that whenever | |
// a new item is emitted by the source Publisher, it will unsubscribe to and stop mirroring the Publisher | |
// that was generated from the previously-emitted item, and begin only mirroring the current one. | |
func flatMapLatest<T: Publisher>(_ transform: @escaping (Self.Output) -> T) -> Publishers.SwitchToLatest<T, Publishers.Map<Self, T>> where T.Failure == Self.Failure { | |
map(transform).switchToLatest() | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io.reactivex.rxjava3.core.Observable | |
import io.reactivex.rxjava3.core.Scheduler | |
import io.reactivex.rxjava3.core.Single | |
import io.reactivex.rxjava3.kotlin.subscribeBy | |
import io.reactivex.rxjava3.schedulers.Schedulers | |
import java.util.* | |
import java.util.concurrent.TimeUnit | |
import java.util.concurrent.atomic.AtomicInteger | |
import kotlin.math.pow | |
import kotlin.random.Random |