rodydavis / signals.dart

Reactive programming made simple for Dart and Flutter
http://dartsignals.dev
Apache License 2.0
437 stars 50 forks source link

Feat: added `refreshAndAwait()` to set refresh and await until the loading completes #274

Closed SPiercer closed 2 months ago

SPiercer commented 3 months ago

Added .refreshAndAwait() to FutureSignal in order to do .refresh() but instead of it just changing the state it awaits the future to recompute and finishes the refreshing

good for drag down to refresh indicators and other loading indicators that rely on completing futures since isRefreshing/isReloading is different than isLoading

rodydavis commented 3 months ago

Why would you not just await a .refresh/reload?

rodydavis commented 3 months ago

.refresh/reload does wait for the internal execution to complete. It just updates the state on each update

SPiercer commented 3 months ago

.refresh/reload does wait for the internal execution to complete. It just updates the state on each update

It doesn't I tried it.

even the code it doesn't await any asynchronous calls.

rodydavis commented 3 months ago

That should be unintended behavior then. I will write a test to validate expectations first

SPiercer commented 3 months ago

any updates ?

rodydavis commented 3 months ago

Preparing for IO connect but should be able to address in the next few weeks

SPiercer commented 2 weeks ago

Hello @rodydavis I've came around again after your recent releases and this issue still persists.

awaiting .refresh or .reload does not waits for the future/computation to finish, i have to rely on my implementation to actually await for the future to recompute again

can we reopen this PR or do something about it?