Is there anything built-in in Flow that would ignore the repeated calling of
home()
method and let the existing request fail or reach success?
w
wasyl
08/10/2020, 11:00 AM
I think SharedFlow is the closest to what you’d like, but it’s not released yet. I’m not sure it’d support your use case exactly, but I don’t think there’s anything built-in right now
s
Sudhir Singh Khanger
08/10/2020, 11:03 AM
Thanks. In that I case I will enable/disable the button once I start the asynchronous work and get up to desired state.
z
Zach Klippenstein (he/him) [MOD]
08/10/2020, 3:36 PM
`SharedFlow`/`StateFlow` could help here, but I think you’d still have another problem to solve. I’d suggest using a library like Dropbox’s Store (https://github.com/dropbox/Store) which handles this sort of debouncing for you.