SolidJSS
SolidJS2y ago
12 replies
halu

SOLVED: Non-Reactive Memo for Reactive Values?

I wish to perform a memoized calculation on demand rather than optimistically.

Here we see createMemo running optimistically:
https://playground.solidjs.com/anonymous/63165594-60fe-4ff2-966f-620574dd5761


Here i've solved the problem by manually tracking the dirty state
and determining whether to recalc or just return at call time:
https://playground.solidjs.com/anonymous/21a6530b-632c-46df-80d6-48ddd75ba665


I'm fine with this solution, but i just wanted to check that i'm not missing anything obvious
Quickly discover what the solid compiler will generate from your JSX template
Quickly discover what the solid compiler will generate from your JSX template
Was this page helpful?