ahmedre/prayertimes-kmp

mvi discussion

Closed this issue · 2 comments

I know here is not the best place to answer, but I know you are a Muslim brother who can always help
just a question
let us have a function in the ViewModel that can handle any event on ViewModel, this is the same as reducing fun in JS.redux

fun reduce
        viewModelScope.launch {
            event.collect {
                     is YachtsCheckoutViewModelContract.Event.EnterEmail -> onEmailEntered(event.text)
            }
        }
    }

he text typing is slow and the cursor sometimes goes between the characters, I do want to have single handle event function but this is not working very well , any ideas on how making this super fast , plz any help

something like debounce would probably help here, so if in a x ms window, the person typed 10 things, it would only consider and use the last one.

may Allah bless you