AxelSorensen
Automatic pending state for data being fetched?
Thanks @Mähh
I would really like to not have to initialize my variables as objects with pending and data keys as this clutters the code.
My dream scenario is simply that I can somehow check if a variable is currently in a "fetching state"
For example imagine:
I wonder whether a value that is currently being assigned with await has some kind of metadata associated with it that I could query to trigger my loading animation.
30 replies
Automatic pending state for data being fetched?
Take a look at my example in my post:
I want a wrapper around any data, that will show the data if it is fetched or default to a loading indicator.
This would mean that in my main app I could handle all the data fetching and as long as i wrap my data in this wrapper:
<wrapper>{{data}}</wrapper>
or pass it as a prop
<wrapper :data="data"/>
Would show "loading" or "data" depending on the fetchstate of the given data
30 replies
Automatic pending state for data being fetched?
Right, but what I would really love is to automatically detect that data is being awaited and whenever it is, display some arbitrary loading indicator. I know this can be done with <Suspense/> in React for example, but again this only applies to first time the data is being fetched it seems
30 replies