Class AttachmentFetcher

These objects are returned by calls to fetchAttachment() on Collection and allow you to stop an in-flight attachment fetch.


  • AttachmentFetcher





attachment: Promise<Attachment>

Returns a promise for the attachment that you can await. The promise resolves to either an attachment or null if the attachment has been deleted meanwhile. The promise is rejected if an error occurs during the fetch. Note that the AttachmentFetcher itself implementes PromiseLike, so you can await it directly.


  • Stops fetching the associated attachment and cleans up any associated resources.

    Note that you are not required to call stop() once your attachment fetch operation has finished. The method primarily exists to allow you to cancel an attachment fetch request while it is ongoing if you no longer wish for the attachment to be made available locally to the device.

    Returns void