mirror of
https://github.com/accelforce/Yuito
synced 2024-12-22 21:28:08 +01:00
5e8a63a046
Introduce Flow<T>.throttleFirst(). In a flow this emits the first value, and each value afterwards that is > some timeout after the previous value. This prevents accidental double-taps on UI elements from generating multiple-actions. The previous code used debounce(). That has a similar effect, but with debounce() the code has to wait until after the timeout period has elapsed before it can process the action, leading to an unnecessary UI delay. With throttleFirst a value is emitted immediately, there's no need to wait. It's subsequent values that are potentially throttled. |
||
---|---|---|
.. | ||
android/text | ||
com/keylesspalace/tusky |