Open mortend opened 3 years ago
This makes it possible for clients to implement their own download logic and provide a local URL to the image once the download is complete.
This is useful when authorization is required to access images, or any scenario where public URLs to your images aren't available.
Client sets image.url to empty string as a placeholder.
image.url
Client implements props.onLoad(index, callbacks) like so:
props.onLoad(index, callbacks)
async onLoad(index, callbacks) { try { const url = "file://" + (await downloadImage(index)) callbacks.onLoaded(index, url) } catch (e) { callbacks.onFailed(index) } }
Rock'n'roll!
This makes it possible for clients to implement their own download logic and provide a local URL to the image once the download is complete.
This is useful when authorization is required to access images, or any scenario where public URLs to your images aren't available.
Usage
Client sets
image.url
to empty string as a placeholder.Client implements
props.onLoad(index, callbacks)
like so:Rock'n'roll!