koufa
flowOf("one string", "second string", "third string") .debounce(300) .map { it.trim() } .filter { it.length > 2 } .flowOn(Dispatchers.Default) .distinctUntilChanged() .switchMap { // Simulate server call delay(2000) flow { // Just return search term for the moment emit(it) } } .flowOn(<http://Dispatchers.IO|Dispatchers.IO>) .collect { _viewState.value = it }
collector
streetsofboston
_viewState
value
runBlocking { ... }
_viewState.value
A modern programming language that makes developers happier.