RGJS6 Firebase Storage Module
Methods
-
<static> setDefaultStorage(storage)
-
Set default database.
Parameters:
Name Type Description storageobject A Firebase storage object.
Example
const storage = firebase_app.storage(); rgjs.firebase.db.setDefaultStorage(storage);
-
<static> upload(path, data [, args])
-
Upload a data blob.
Parameters:
Name Type Argument Description pathstring The destination path of the file to write.
datablob The data to upload.
argsargs <optional>
Arguments: {opts: {metadata: {contentType: null, cacheControl: null,},},}.
Returns:
Resolved with downloadURL.
- Type
- promise
Example
rgjs.firebase.storage.upload('/files/file.blob', blob, metadata);
Type Definitions
-
args
-
Generic arguments for rgjs.firebase.storage functions.
Type:
- object
Properties:
Name Type Description cbfunction Optional. Callback, called on success with argument
downloadURL.cberrfunction Optional. Error callback, called when an error occurs with argument Error.
cbprogressfunction Optional. Progress callback, called on progress with argument UploadTaskSnapshot.
storagedatabase Optional if
setDefaultStorage()is used. The Firebase storage object to use.optsobject Options.