Initial state with a HTTP query #472
Unanswered
UnleashSpirit
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Good morning,
I'm sure this question has been asked before, but I don't know how to do what I want.
My use case is quite simple, I would like to initiate the store on first subscription by an http request (not on store creation) and cache that until the store resets or cleans up the trigger cache one way or another.
All examples show subscription to fetch function and never store subscription.
My idea was:
And the first subscription triggering the fetchData somehow to initialize the store, and not having to explicitly subscribe to the fetchData and the store.
With a way to force the http request again to refresh the cache
Is there an elegant way to do this or am I completely wrong and that's not how I should do it?
Cheers
Beta Was this translation helpful? Give feedback.
All reactions