Replies: 2 comments 1 reply
-
Your key passed to And even if you fix all that, your function is still async. So if your key |
Beta Was this translation helpful? Give feedback.
-
Made the following change
The second thing is, as per the documentation, "Later, when the HookWidget rebuilds, the call to useMemoized will return the previously created instance without calling valueBuilder.". Here, the current value/instance is say, 2, the previous instance will therefore be 1, and the next instance will be 3. The result of 2 instances is cached - previous and next (1 & 3). The documentation says "return the previously created instance". But when I press the increment button the next instance is immediately returned. This behavior should only happen with the previous instance. Why is the next returning instance being cached? |
Beta Was this translation helpful? Give feedback.
-
useMemoized is caching both values previous and next. Also, log('Wait Over') runs twice. Isn't useMemoized suppose to cache only the previous value? Please explain
Beta Was this translation helpful? Give feedback.
All reactions