-
Notifications
You must be signed in to change notification settings - Fork 58
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
Watch can not react to lazy signal being initialiazed #310
Comments
This is interesting! I will see if I can find a way to trigger a subscription. But it also may be a works as expected too. Will do some research! |
We may have something like I'm too busy using signals.dart but I'm curious how react, angulars and other deal with such case :) |
Another approach would be a Lazy( mySignal,
unset: Text('not cooked'),
child: Text(mySignal()); |
Keep the wonderful simple api with Watch((_) => ...), lazies = [lazySignal1, lazySignal2]) Should be easier to implement to. |
I think another approach would be to make the initialization check a signal too so it will subscribe regardless! |
If possible it would be the best option!
Le mar. 3 sept. 2024 à 21:41, Rody Davis ***@***.***> a
écrit :
… I think another approach would be to make the initialization check a
signal too so it will subscribe regardless!
—
Reply to this email directly, view it on GitHub
<#310 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJ4MWIMQXRIA32DOMVNURDZUYGHFAVCNFSM6AAAAABNSSS3HWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRXGI4TCNJWHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Initializing a lazy signal will not trigger a Widget rebuild as
.value
maybe out of the logic execution (if condition) asisInitialized
bar it.We need the way to register
signal()
underWatch(...)
without triggering a non initialized error.Thanks!
Quick code for you to reproduce
The text was updated successfully, but these errors were encountered: