Closed p-himik closed 10 months ago
Hey @p-himik, do you have a repro for this?
The vals of the cache are reactions. I'm not sure what a user would do to put a nil or false in there.
You're absolutely right, this issue is just a documentation of my poor judgement on that day.
Yeah it is kind of vexing when re-frame double-derefs things to get the job done, haha.
What do you suggest?
This is how the cache lookup is implemented:
And this is the important part of how it's used:
if-let
returns its "else" branch whencached
is eithernil
orfalse
. And thus it always recomputes the sub value when it'sfalse
.if-some
would be better because then it would return the "else" branch only when the value isnil
. But a proper solution would use some singleton value with thatget
from the first block and check for it instead of usingif-let
/if-some
.