Closed seanaguinaga closed 3 weeks ago
undefined values also seem to be written - which I saw a commit that should have made that impossible?
Hey @seanaguinaga ! So the default value provided to the makeCachedVar API is replacing an existing value in the cache when it shouldn't be? Yea it should only use the default value instead if there isn't a falsy value there already. Do you have a repro I can look at?
My mistake!
I was not importing the sync version, but I was calling it synchronously.
Switched to sync and that issue is gone!
🤦♂️ it was one of those days
I noticed that even persistCacheSync has persistenceMapper on it, but it does not fire, is that intentional?
Hello
How do you make sure that makeCachedVar doesn't overwrite the existing value if there is one in the cache?
I am not sure how you would initialize something without rewriting what is there? Is there a read-only function not in the docs?