Davide Giuseppe Farella

    Davide Giuseppe Farella

    2 years ago
    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 ) :
    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
    Arkadii Ivanov

    Arkadii Ivanov

    2 years ago
    Looks like MVI. Maybe MVIKotlin would help?
    Davide Giuseppe Farella

    Davide Giuseppe Farella

    2 years ago
    Thank you, that a very nice project and the time-travel is crazy, but I prefer to solve without any framework