.watch(context) vs Watch differences #278
Replies: 3 comments
-
The biggest difference is that Watch will rebuild for inherited widgets listened instead the callback (theme/media) and is an effect. .watch calls the subscribe method for a specific signal. That being said I am very interested and will see if we can get some tests added to make sure they are aligned as much as possible (inherited widgets will rebuild a lot more outside of my control). |
Beta Was this translation helpful? Give feedback.
-
Could you share a minimal example for reference? |
Beta Was this translation helpful? Give feedback.
-
@rodydavis I just started playing around with this library and was wondering the same thing. I didn't fully understand this phrase:
What does this mean? That if an inherited widget changes higher in the tree it will rebuild the Watch widget? I would like to understand the differences, using |
Beta Was this translation helpful? Give feedback.
-
I've been using
signals
/lite_ref
in my project, and part of my implementation relies on overriding a scoped dependency to provide demo data for a "preview" mode of a particular set of widgets.I ran into an issue where I had to replace my
Watch
for.watch(context)
as it did not work correctly otherwise:jinyus/lite_ref#24
As I figured that
Watch
and.watch(context)
were interchangeable (and especially considering the docs suggest usingWatch
over.watch(context)
), are there any other/specific scenarios where this is expected?Beta Was this translation helpful? Give feedback.
All reactions