Resource
of use_resource
state should go back to Pending
when a dependency changes.
#2812
Labels
Milestone
Problem
When using
use_resource
with reactive, dependencies, the state go fromPending
toReady
, but when the future is restarted (when a dependency changes), the state remainsReady
.This should be pretty easy to fix, just change the implementation here:
dioxus/packages/hooks/src/use_resource.rs
Line 31 in b97e607
Note that the behaviour of
SuspenseBoundary
would change. It would display the fallback each time the future is restarted. But that would make more sense in my opinion.A related issue would be to update the docs of
use_future
to clarify that it will not re-run when the dependencies changes, and that one should useuse_resource
instead.Environment:
master
The text was updated successfully, but these errors were encountered: