Open zoltlabs opened 1 month ago
I found when I remove persistence for it, this issue disappears... but that's kind of a problem since I do need persistence.. I'm using AsyncStorage for reference.
A possible culprit: It appears that legend state is occasionally writing an unresolved promise to async storage as opposed to the final result of the promise, which then results in an issue later on.
Oh interesting! Do you see a pattern for when it's doing that?
Not sure if this is the same issue, but I am also running into something similar.
If I use .get()
by itself I get a result, but if I try to use any kind of mapping functions I get the undefined error.
For example:
const recipes = recipes$.get().values();
gives me:
ERROR TypeError: recipes$.get().values is not a function (it is undefined)
This happens with keys()
or has()
along with others.
Oh that might be it! I didn't actually think that would make a difference but maybe inadvertently that would be what would be fixing it.
Hi @jmeistrich I know there are a lot of issues to manage, but wondering if you had some insight on this. I'm happy to contribute, but may need a little direction first.
Sorry, I've been really busy preparing a talk and then a workshop for the past couple of weeks. I'm at React Native London today then I'm going to catch up on issues. So I'll try to fix this soon!
No worries, I completely understand. Thanks!
Hi, I get an error saying:
TypeError: cache.get is not a function (it is undefined)
.For reference:
export const cache$ = observable(new Map<string, string>
The code where it throws this error looks like this, within a React component:I don't know why this would be happening.. I'm pretty stumped.
In my
_layout.tsx
, I persist it like:export const cacheSave = syncObservable(cache$, { initial: new Map(), persist: { name: 'zcache' } });
For reference, this is the call stack: