Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hook to observe didChangeDependencies #397

Open
water-mizuu opened this issue Nov 30, 2023 · 0 comments
Open

Add hook to observe didChangeDependencies #397

water-mizuu opened this issue Nov 30, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@water-mizuu
Copy link

Is your feature request related to a problem? Please describe.
Basically, I have a complicated [Widget] which uses [didChangeDependencies] to update state intricately. This involves animations, and with it, comes asynchronous functions. I would like to allow hooks to listen to lifecycle method [didChangeDependencies] as hooks can to [initState] and [dispose], additionally helping parallel the [State] object of [Widgets].

Now, why wouldn't it be applicable to being put in [build] instead? Because I don't want [didChangeDependencies], (and the code inside it) to be run on every [setState]. It should only run when the dependencies it has from providers update.

Describe the solution you'd like
As described above, just modify the [HookElement] mixin to allow listening to [didChangeDependencies] on each hook. I could do this on a local version of the library, but it would be nice to have it as an official change.

Describe alternatives you've considered
None.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants