Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

how to check if fetching more, network status undefined #67

Closed
zebapy opened this issue Feb 1, 2019 · 3 comments
Closed

how to check if fetching more, network status undefined #67

zebapy opened this issue Feb 1, 2019 · 3 comments

Comments

@zebapy
Copy link

zebapy commented Feb 1, 2019

Using the query as

  const { data, loading, networkStatus, fetchMore } = useQuery(query, {
    variables,
    skip,
    notifyOnNetworkStatusChange: true
  });

networkStatus seems undefined when console logging so I can't do const loadingMore = networkStatus === 3

@trojanowski
Copy link
Owner

@zebapy I have mostly working implementation in #68. It works without problems in the non-suspense mode. Unfortunately, the suspense mode requires some ugly hacks to work (

unstable_scheduleCallback(() => {
), so I'm going to try to find an alternative solution or just don't support the suspense mode initially.

@zebapy
Copy link
Author

zebapy commented Feb 1, 2019

Seems fine that it doesn't trigger suspense, since in my case, I want to update a button to say "loading more..." instead of hiding all the currently loaded content which happens being wrapped in some other Suspense

@trojanowski
Copy link
Owner

It's already fixed in v0.4.0 for the non-suspense mode. For suspense the fix is quite hacky so I decided to postpone it until Suspense for data fetching is considered ready by the React team. Added to a list of know issues in #88.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants