Wild
Explore posts from serversCreate one global store with multiple createResource
Hello,
I am a beginner programmer developing a small local app with Tauri and SolidStart.
In the past, I have already worked on a personal website with Nuxt/Vue/Pinia.
The data being exclusively stored on a local sqlite database, I am trying to load all the data from the start of the program execution, and intend to make it available to all components from a store.
How do I initialize my store within context with createResource ? my context is undefined
I've made sure the data fetching part works. I tried to wrap the AppContext.Provider with Suspense, my guess being the async is messing things up here. Thank you
3 replies
useASyncData & watch issue
Hello friends,
I've been having a hard time using watch. I've finally found a suitable ref for watch, but the refresh is too late. My store update but what is displayed is one step behind.
If i change the lang from fr to en, it'll show fr, and from en to es, it'll show es.
What am I missing ?
If I use a plugin with and manually call refresh, it works as I would like it to.
Thanks for your time !
2 replies
Is it possible to initialize store state with async function ?
Hello friends,
I am trying to set up my store from indexedDb.
I've seen an example with useLocalStorage from vueUse, but how can I make it works with custom function ?
Thank for the help
8 replies
Need some help about useFetch usage
Hello friends,
anyone knows why a useFetch would trigger once on the client although the getCachedData return data from localstorage ? I got getCachedData into getCachedData into onReponse into Transform.
Some code since it might help :
2 replies
Data Fetching, Store and LocalStorage
Hello friends,
I am trying to understand the store lifecycle, but I have yet to find a good article / document on the topic.
I understand that there is data fetching from the server and from the client.
I was originally planning to set up a store and initializing some state from the server, for website often-updated data with usefetch server true, and some persitent data with a mix of usefetch server false and localstorage.
My issue is that I cannot control when the state is set up, and so localstorage and client side state initialization fails unless I use some kind of onMounted, getCurrentInstance and process.server shenanigans.
I want control when the state is set up, because at the moment I just get an empty {} : the state try to initialize once, fails which is normal cause SSR.
Should I just trigger some actions from the client ? This seems like a lot of boilerplate.
Any relevant resource or document ?
Is there a way to control when the store is set up ?
How would you approach this kind of thing ?
I was trying to keep things simple because all that's needed is a nicely timed localstorage getitem and setitem, but maybe I should look into some persisted state plugin.
Thank you very much for your help, insight and time
7 replies