Skip to content

Conversation

@DanielAlbl
Copy link
Contributor

So I had tried using a UseSharedState as a dependency for use_future, and it wasn't re-running when it changed. I think this was because it was comparing the .inner values which still were pointing to the same data.
I implemented a special UseFutureDep so it would compare a gen value, sort of following the example of UseRef. I did have to remove the PartialEq here to avoid conflicting with this: impl<A: Dep> UseFutureDep for &A, but this might not be the right thing to do.

@ealmloff ealmloff added enhancement New feature or request hooks Changes to built-in hook package labels Aug 22, 2023
@DanielAlbl DanielAlbl force-pushed the gen-in-use-shared-state branch from 74f7f01 to 818edaf Compare August 26, 2023 22:05
@DanielAlbl DanielAlbl force-pushed the gen-in-use-shared-state branch from 818edaf to 46cf79b Compare August 26, 2023 22:16
@DanielAlbl DanielAlbl changed the title Special case UseFutureDep for UseSharedState Aug 30, 2023
Copy link
Member

@ealmloff ealmloff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I lost track of this. Looks good, thank you!

@ealmloff ealmloff added the breaking This is a breaking change label Sep 2, 2023
@ealmloff
Copy link
Member

ealmloff commented Sep 2, 2023

Clippy failure is unrelated. This change can potentially be breaking (this could fail to memorize some props). Waiting for a second review before merging

@ealmloff ealmloff merged commit 18dca07 into DioxusLabs:master Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking This is a breaking change enhancement New feature or request hooks Changes to built-in hook package

2 participants