You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I realized that
createMemo
is not lazy - it calls callback as soon ascreateMemo
defined. This leads to several inconsistensesCurrent state of view might not need actual value of that memo, so computation could be defer:
In this example we do not need memoizedValue, until
otherFlag()
is set.Second example is about messing with Suspenses, I extracted to playground https://playground.solidjs.com/anonymous/81480f12-9cf2-46b2-8a1e-4f98917b74d2
tldr: using
createMemo
could implicitly trigger resource to load, resulting in triggering unexpected Suspense boundaryWhat is the reason for making
createMemo
eager instead of lazy?Beta Was this translation helpful? Give feedback.
All reactions