https://kotlinlang.org logo
d

Davide Giuseppe Farella

08/15/2020, 10:04 PM
Hello, I’m trying to find a replacement for
actor
, for implement a debounce operator. On jvm I would write ( I’ll skip something for simplicity ) :
Copy code
val result = MutableStateFlow(emptyList<Movie>)

val searchActor = scope.actor<String>(CONFLATED) {
  for (query in channel) {
    delay(250) // debounce
    result.value = searchMovie(query)
  }
}

// Outer world
launch { result.collect { ... } }
searchActor.send(query)
What would be a nice solution on KMP? Thank you
a

Arkadii Ivanov

08/15/2020, 11:00 PM
Looks like MVI. Maybe MVIKotlin would help?
d

Davide Giuseppe Farella

08/15/2020, 11:30 PM
Thank you, that a very nice project and the time-travel is crazy, but I prefer to solve without any framework
9 Views