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
Here is the store view to get rootStore in trendsStore
.views((self) => ({
get store() {
return getRoot<IRootStore>(self);
},
}))
And when I call makeTrendsSearch, request time from network tab is 3 seconds, but here in console.log it can be 3.8-4.5seconds
It means it takes 1 second more then real request.
Also I tried to change this const response = yield self.store.queryNews({}, queryFragment, { fetchPolicy: 'no-cache' }).promise;
to plain fetch, and it show the same time as network tab
Yes, i know the queryNews is converting respoinse to mst model, but still.
My questions are:
How can I improve the code to have the same time as in network tab?
Is it correct using mst-gql in general to have shared data between stores?
The text was updated successfully, but these errors were encountered:
HI @igor90... Im helping @jesse-savary with these issues and I'll try to act as a community manager to get things back on track... If you need anything let me know
Hey
I have project similar to 3-twitter-clone example.
I create a couple of seperated stores and injected them in rootStore:
then I create seperate hook to get that store
export const useTrendsStore = (): ITrendsStore => useQuery().store.trendsStore;
And in compontent I use
const trendsStore = useTrendsStore();
Here is the action from trendsStore
Here is the store view to get rootStore in trendsStore
And when I call
makeTrendsSearch
, request time from network tab is 3 seconds, but here in console.log it can be 3.8-4.5secondsIt means it takes 1 second more then real request.
Also I tried to change this
const response = yield self.store.queryNews({}, queryFragment, { fetchPolicy: 'no-cache' }).promise;
to plain fetch, and it show the same time as network tab
Yes, i know the
queryNews
is converting respoinse to mst model, but still.My questions are:
How can I improve the code to have the same time as in network tab?
Is it correct using mst-gql in general to have shared data between stores?
The text was updated successfully, but these errors were encountered: