Closed domyn closed 4 years ago
Hi, these break structured concurrency, which is not a practice I'm encouraging because it can very easily lead to memory, computational or listener leaks (or all of these).
That said, Splitties already has awaitOneClick()
extension function for View
in the Views Coroutines split, which allows you to integrate click listening neatly in your suspending function, and disable the button once clicked, until your code is ready to handle a newer click (using a loop, or a flow collector for example).
This is a different approach, but I believe it's better that what Anko listeners offered in terms of design and risks involved.
Hi, it would be great to have suspend listeners like those from Anko (see here) available in e.g. Views Coroutine splittie. Could you add those please?