TEST ONLY: Gets the current borrow count for a blob reference. This should only be used in tests to verify reference counting behavior.
The blob reference to check
The number of times the blob reference has been borrowed, or 0 if not borrowed
Do NOT use this directly, use useBorrowUrl hook instead as it will automatically return the url when the component unmounts.
Creates a new remote blob ref. The url must start with http. This should only be called if the remote content is persistent and immutable.
Resolves once every deferred blob write has reached durable storage. Rejects if any deferred write failed. Call this before persisting any document that references local blob refs — it is the durability barrier that makes deferred writes safe.
Gets a blob from the blob store or null if it is not available.
Stores a blob and returns a reference to it. Blob references are based upon the content and type of the Blob. If an equivalent blob is stored, an equivalent reference will be returned every time.
The returned ref is readable immediately, but its durable (storage-tier) write is deferred off the critical path. Any layer that persists a document containing a local blob ref MUST await BlobStore.flush first, or the persisted ref may point at bytes that never reached storage and will not resolve after reload.
Checks if the blob is still available.
Removes a blob from the store.
Return a url that was previously borrowed from borrowUrl. Failure to do so may result in memory leaking.
The url provided by borrowUrl.
Augments an existing local blob ref with a remote URL, producing a combined
ref (same content identity, now also re-fetchable at the URL). The URL must
start with http and MUST serve immutable content whose hash equals the
ref's localBlobRef; the local fast-path and dedup identity are preserved.
A local (or already-combined) blob ref.
The persistent, immutable URL the same content is served from.
A blob store is a service that can efficiently store blobs across sessions and retrieve them using the browsers Cache api.