nitish24p/react-worker-image

Lazy Loading support of an Image

Opened this issue · 6 comments

Fallback image if image loading fails.

What do you mean by if image loading fails.

  1. Incorrect url or
  2. The resource fetch fails..

In case of 1, if it fails due to incorrect url then a lazy load will also not be solving any problem. In case of 2, where image resource fails, i think we can add a catch block in the web worker script, and then use post message api.

Fallback image was another enhancement suggested.

In either case, fallback image should be displayed.
For an e.g. Fetching movie poster, if URL incorrect/resource fetch failed, there should be default fallback image which kind of depicts the poster is for movie category.

How will this be diff from placeholder

@nitish24p I suppose what is trying to tell is placeholder is image tag right? this will a fallback image incase we do not find that image src.

Meaning a default one

Ahh okay.. got it.. cool makes sense.. :) So this is also something which can be taken as a prop.. so its customisable

@vihangpatel you can make a PR for this if you want.. 👍