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

Feature Request: Loading States? #149

Closed
james-ff opened this issue Apr 12, 2019 · 3 comments
Closed

Feature Request: Loading States? #149

james-ff opened this issue Apr 12, 2019 · 3 comments

Comments

@james-ff
Copy link

This issue is a: Feature request

Description

It would be nice if there were loading states, so that it would be possbile to show a template image or loading component while an image is loading. Or maybe I'm missing some easy way that already exists? Thanks!

@rpearce
Copy link
Owner

rpearce commented Apr 12, 2019

@james-ff This sort of event / state callback sounds like a good idea to include in the rewrite (see #143).

I've not been able to dedicate time to the project recently (injury + work), but this is the next big thing on my list to do (my OSS priority board https://github.com/users/rpearce/projects/1/).

Thanks for the suggestion.

@rpearce
Copy link
Owner

rpearce commented Oct 6, 2019

With the way we're doing the rewrite, I don't think this will be something the library will handle, and whatever you would normally do in the browser in this situation should suffice.

I'll keep this issue open until we are further along, though.

@rpearce
Copy link
Owner

rpearce commented Dec 18, 2019

The way I've done the upcoming v4, you can do whatever you want while your image is loading (you do whatever you want), then once you detect that it loads, you merely wrap it in the <Zoom> component. So... (pseudo-code):

{isLoading && <Spinner />}
{isLoaded && <Zoom><img src="..." ... /></Zoom>}

While v4 is still in alpha, that should resolve this issue, and I'm going to close this to clean up the issue tracker. If you feel differently about my closing it, please let me know.

@rpearce rpearce closed this as completed Dec 18, 2019
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