Closed ng-ha closed 3 weeks ago
@ng-ha yes, it's pretty trivial to add. I'll have more time next week to do it.
// ios/FasterImageViewManager.swift
@objc
func prefetch(_ sources: [String],
resolve: @escaping RCTPromiseResolveBlock,
reject: @escaping RCTPromiseRejectBlock) {
do {
let prefetcher = ImagePrefetcher()
let urls = sources.map { url in URL(string: url )}.compactMap{ $0 }
prefetcher.startPrefetching(with: urls)
resolve(true)
} catch { reject() }
}
hi @gtokman , does the preload feature is working on this library? btw, Thank you for your great lib.
@gtokman I think 'sources' should have the type '{uri, header}[]'. Please implement the 'prefetch' feature, and I will contribute additional code for the Android platform.
Is this feature being considered? It's an important one for me too
Hopefully this feature will be added soon!
Added prefretch in the latest version.
Does this library support to preload images or plan to support this feature in the future?