import { ... } from 'react-firehooks/storage';Returns the data of a Google Cloud Storage object as a Blob
This hook is not available in Node.
const [data, loading, error] = useBlob(storageReference);Params:
reference: Reference to a Google Cloud Storage objectmaxDownloadSizeBytes: If set, the maximum allowed size in bytes to retrieve.
Returns:
value: Object data as a Blob;undefinedif data of the object is currently being downloaded, or an error occurredloading:truewhile downloading the data of the object;falseif the data was downloaded successfully or an error occurrederror:undefinedif no error occurred
Returns the data of a Google Cloud Storage object
const [data, loading, error] = useBytes(storageReference);Params:
reference: Reference to a Google Cloud Storage objectmaxDownloadSizeBytes: If set, the maximum allowed size in bytes to retrieve.
Returns:
value: Object data;undefinedif data of the object is currently being downloaded, or an error occurredloading:truewhile downloading the data of the object;falseif the data was downloaded successfully or an error occurrederror:undefinedif no error occurred
Returns the download URL of a Google Cloud Storage object
const [url, loading, error] = useDownloadURL(storageReference);Params:
reference: Reference to a Google Cloud Storage object
Returns:
value: Download URL;undefinedif download URL is currently being fetched, or an error occurredloading:truewhile fetching the download URL;falseif the download URL was fetched successfully or an error occurrederror:undefinedif no error occurred
Returns the metadata of a Google Cloud Storage object
const [metadata, loading, error] = useMetadata(storageReference);Params:
reference: Reference to a Google Cloud Storage object
Returns:
value: Metadata;undefinedif metadata is currently being fetched, or an error occurredloading:truewhile fetching the metadata;falseif the metadata was fetched successfully or an error occurrederror:undefinedif no error occurred
Returns the data of a Google Cloud Storage object as a stream
This hook is only available in Node.
const [data, loading, error] = useStream(storageReference);Params:
reference: Reference to a Google Cloud Storage objectmaxDownloadSizeBytes: If set, the maximum allowed size in bytes to retrieve.
Returns:
value: Object data as a stream;undefinedif data of the object is currently being downloaded, or an error occurredloading:truewhile downloading the data of the object;falseif the data was downloaded successfully or an error occurrederror:undefinedif no error occurred