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
Disclaimer: I'm new to Svelte and not too familiar with TypeScript.
I'm following the README but adapting it along the way for my own project. The API endpoint I'm calling is very similar to the petstore example: It is returning an array of objects.
My API call doesn't take any params but I still had to pass an empty config: findPetByStatus({}). I thought I could use findPetByStatus()?
{#if resp.ok} should be {#if resp?.ok}
resp.data is an array (see screenshot below) but I still get Error: {#each} only works with iterable values.. I looked at the demo project which passes resp.data to another Svelte component that exports a typed property. But I haven't yet figured out how to pull that of without a child component (e.g. something like doing {#each (resp.data as MyArrayType) as pet}).
Edit: I also tried to subscribe to the response store as per the README (Subscribing to response store) and save the result into let devices: Devices = [];. Still the same error.
The text was updated successfully, but these errors were encountered:
Disclaimer: I'm new to Svelte and not too familiar with TypeScript.
I'm following the README but adapting it along the way for my own project. The API endpoint I'm calling is very similar to the petstore example: It is returning an array of objects.
For reference, this is the READMEs example:
Couple of things I noticed so far.
findPetByStatus({})
. I thought I could usefindPetByStatus()
?{#if resp.ok}
should be{#if resp?.ok}
resp.data
is an array (see screenshot below) but I still getError: {#each} only works with iterable values.
. I looked at the demo project which passesresp.data
to another Svelte component that exports a typed property. But I haven't yet figured out how to pull that of without a child component (e.g. something like doing{#each (resp.data as MyArrayType) as pet}
).Edit: I also tried to subscribe to the response store as per the README (
Subscribing to response store
) and save the result intolet devices: Devices = [];
. Still the same error.The text was updated successfully, but these errors were encountered: