RGJS6 Firebase Storage Module
Methods
-
<static> setDefaultStorage(storage)
-
Set default database.
Parameters:
Name Type Description storage
object 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 path
string The destination path of the file to write.
data
blob The data to upload.
args
args <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 cb
function Optional. Callback, called on success with argument
downloadURL
.cberr
function Optional. Error callback, called when an error occurs with argument Error.
cbprogress
function Optional. Progress callback, called on progress with argument UploadTaskSnapshot.
storage
database Optional if
setDefaultStorage()
is used. The Firebase storage object to use.opts
object Options.