chrisben / imgcache.js

JS library based on the File API to cache images for offline recovery (target: cordova/phonegap & chrome)
Other
826 stars 216 forks source link

Implement feature useCachedBackgroundWithSource #195

Closed victorivens05 closed 7 years ago

victorivens05 commented 7 years ago

Hello.

I'm using ImgCache.js and recently I was implementing it in a div with background image. Everything worked just fine, except for the fact that I needed to set the background image before use useCachedBackground(), and that meant another request(s), that didn't need to be done. I have some images showing at once and in an app, this requests can hurt.

For that reason I implemented by myself the method useCachedBackgroundWithSource in my node_modules' imgcache.js and it worked in my scenario. The question is if that's a feature worth adding, and if so, how could I pull request (i'm kinda newbie on that), or if it's needed at all, since the change was really simple.

Thanks.

adrianmarinica commented 7 years ago

Hey! I created a pull request with this change, as I also needed it badly. https://github.com/chrisben/imgcache.js/pull/196

Can it be merged?