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
Hi, I have observed a behavior which I cannot really get my head around and thought I'd ask you guys what the issue might be:
// I do some data fetching here. The result is the conferenceData observable which// allows subscribing to return values via svelte store syntax// using the new async svelte, I use await which will guarantee the observable to have a value presentconstconferenceData=awaitclient.query.conferenceUsers({
...
});
when I now inspect the subscribed value $inspect($conferenceData) I see undefined and then immediately the actual value when I look into my browser console. Thinking this might be because the initial value might somehow not be set correctly, I wrapped this into a readable which resolves the problem:
That's nice. I want to move this to my library so the above call will do this automatically. So I imported svelte/store and did exactly what I did above but in my data fetching library. And the undefined returned. So somehow it makes a difference if the store is created inside my component?!
Anyone have any idea why this happens? I know async is still in beta and I'm not sure if this is an issue on my part or actually needs to be addressed. Thanks for your time!
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
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I have observed a behavior which I cannot really get my head around and thought I'd ask you guys what the issue might be:
when I now inspect the subscribed value
$inspect($conferenceData)I seeundefinedand then immediately the actual value when I look into my browser console. Thinking this might be because the initial value might somehow not be set correctly, I wrapped this into areadablewhich resolves the problem:This never shows
undefined.That's nice. I want to move this to my library so the above call will do this automatically. So I imported
svelte/storeand did exactly what I did above but in my data fetching library. And the undefined returned. So somehow it makes a difference if the store is created inside my component?!Anyone have any idea why this happens? I know async is still in beta and I'm not sure if this is an issue on my part or actually needs to be addressed. Thanks for your time!
Beta Was this translation helpful? Give feedback.
All reactions