-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Add onProgress and onComplete to preload. #268
Conversation
Ok, now on Android too! |
fceabd8
to
e618b99
Compare
e618b99
to
ead60db
Compare
This can be easily added on JS side (e.g. when onProgress and onComplete are both undefined, make JS method return promise). |
Hi |
how can i use this feature ? |
Any plans on getting this merged? Would be awesome to not have to fork the repo to use it 😅 |
Please get this merged. |
@DylanVann Merge this please. |
Is there anything preventing this PR from being merged @DylanVann ? Would love to help :) |
# Conflicts: # android/src/main/java/com/dylanvann/fastimage/FastImagePreloaderModule.java # src/index.d.ts # src/index.js
Is there any plan for the PR? |
@DylanVann willing to resolve CI failure to get this merged into the package. Some guidance would be appreciated though. |
Sorry for the lack of response. The reason I did not implement this feature, and the reason I'd be hesitant to merge this is that the API SDWebImage provides for prefetching images is not very good. It does not tell you which images fail and succeed, it only gives you the number of successful loads and failed loads, which seems silly to me. If someone did a PR to improve their API I'd be much more likely to merge something like this. |
Awesome, I was wondering why it hadn't been merged; seems like a good feature. But that is a valid reason not to merge this feature. |
# Conflicts: # README.md # ReactNativeFastImageExample/yarn.lock # android/src/main/java/com/dylanvann/fastimage/FastImagePreloaderModule.java # ios/FastImage.xcodeproj/project.pbxproj # react-native-fast-image-example/src/PreloadExample.js
# Conflicts: # android/src/main/java/com/dylanvann/fastimage/FastImagePreloaderModule.java # src/index.d.ts # src/index.js
Codecov Report
@@ Coverage Diff @@
## master #268 +/- ##
===========================================
- Coverage 94.11% 55.81% -38.31%
===========================================
Files 1 2 +1
Lines 17 43 +26
===========================================
+ Hits 16 24 +8
- Misses 1 19 +18
Continue to review full report at Codecov.
|
@DylanVann and everyone interested I've update this PR. Now iOS progress handler checks if the url it receives is cached on disk. Based on this JS callbacks will now return array of cached urls as first argument. I also merged master, so it's up to date with v7 of this module, and I updated example project to RN 0.60.5. Example project works fine on iOS and Android. However, I haven't tried this in a real project, as I have yet to migrate my app that utilizes preloading to RN 0.60 |
Closing this until we can resolve the blocking issue of SDWebImage not giving enough info. I wrote a |
The title is pretty self-descriptive. Here is the feature request topic: #144
Hopefully will add Android counterpart on Saturday.