Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

progress guessing #6

Open
bryanrasmussen opened this issue Aug 1, 2020 · 6 comments
Open

progress guessing #6

bryanrasmussen opened this issue Aug 1, 2020 · 6 comments

Comments

@bryanrasmussen
Copy link

this isn't so much an issue as a request for new functionality in line with the fetch progress indicators project https://github.com/AnthumChris/fetch-progress-indicators so that I could pass to my Loading fallback how many bytes there were in all to get and how much was left. (or is that actually possible now, haven't gone through the code)

I can fork and make pull request on this if you want

@dai-shi
Copy link
Owner

dai-shi commented Aug 1, 2020

Hey, thanks for opening up the discussion.
The "fetch" in this lib is not tied to the Fetch API, but it can be any async functions.
Furthermore, I don't think we can return state while in suspense, so I'm not sure how to implement the progress indicator. "Incremental loading" is a similar idea, but it's for multiple async functions.

pass to my Loading fallback

Ah, so it's a callback function. That may work, but still the indicator must be shown in non-suspended component, which sounds a bit weird.

@bryanrasmussen
Copy link
Author

hmm, ok sorry I had misunderstood and thought it was just basically for using fetch with suspense.

basically I'm working on a loading animation article where the loading is an svg animation with some guesstimation as to when load complete helping to set the animation (so instead of a indefinitely recurring animation you get an animation that goes from 0 to complete [or goes away when before complete reached because first data being shown])

and I was hoping to combine the loading animation guessing technique with render-as-you-fetch somehow.

@dai-shi
Copy link
Owner

dai-shi commented Aug 1, 2020

The basic idea seems good. Let's assume we only used the Fetch API and could know the progress. Do you show the loading svg animation in the Suspense fallback? A question is how the svg gets progress information.

@bryanrasmussen
Copy link
Author

bryanrasmussen commented Aug 1, 2020 via email

@dai-shi
Copy link
Owner

dai-shi commented Aug 1, 2020

Thanks for the examples.

If you were to use <Suspense fallback={<Loading progress={progress} />}, I'd expect we could load multiple images under the tree. In other words, if the progress is just for one image, we wouldn't need Suspense, but just use the current (traditional) React, maybe?

@bryanrasmussen
Copy link
Author

bryanrasmussen commented Aug 2, 2020 via email

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

No branches or pull requests

2 participants