-
Notifications
You must be signed in to change notification settings - Fork 59
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
Hot reload with SignalProvider
causes create to rerun again
#365
Comments
after trial having |
after second trial i used i'm currently trying to create a good architecture plan using signals with SignalProvider 1. singletons (manual lifecycle
|
Still looking into the best way to solve for keeping the instances stable on hot reload. Currently the create callback is treaded like a computed signal so it would get recreated if signals referenced at creation changed. Hot reload rebuilds computed because of some edge cases in the Watch widget and disposed signals. |
i used check my fork : https://github.com/SPiercer/signals.dart/ |
to reproduce use any example use of
SignalProvider
i.e https://dartsignals.dev/flutter/signal-provider/
as the title says it's so self explainatory
however in this example
the create function always creates a new instance of the Counter object causing a new signal to be created every time !
after long trials the only thing i managed to do is to store it in a variable
this prevents the behavior but trials to be done to find other unexpected behaviours for the lifecycle
The text was updated successfully, but these errors were encountered: