whitespace

This commit is contained in:
nico 2017-06-29 18:33:43 +02:00
parent 96b4a47a52
commit 0f11da0e0b
1 changed files with 41 additions and 41 deletions

View File

@ -9,14 +9,14 @@ providing some iOS and Android specific functionality.
```javascript ```javascript
firebase.storage() firebase.storage()
.ref('/files/1234') .ref('/files/1234')
.putFile('/path/to/file/1234') .putFile('/path/to/file/1234')
.then(uploadedFile => { .then(uploadedFile => {
//success //success
}) })
.catch(err => { .catch(err => {
//Error //Error
}); });
``` ```
@ -24,28 +24,28 @@ firebase.storage()
```javascript ```javascript
const metadata = { const metadata = {
contentType: 'image/jpeg' contentType: 'image/jpeg'
} }
firebase.storage() firebase.storage()
.ref('/files/1234') .ref('/files/1234')
.putFile('/path/to/file/1234', metadata) .putFile('/path/to/file/1234', metadata)
``` ```
### Listen to upload state ### Listen to upload state
```javascript ```javascript
const unsubscribe = firebase.storage() const unsubscribe = firebase.storage()
.ref('/files/1234') .ref('/files/1234')
.putFile('/path/to/file/1234') .putFile('/path/to/file/1234')
.on('state_changed', snapshot => { .on('state_changed', snapshot => {
//Current upload state //Current upload state
}, err => { }, err => {
//Error //Error
unsubscribe(); unsubscribe();
}, uploadedFile => { }, uploadedFile => {
//Success //Success
unsubscribe(); unsubscribe();
}); });
``` ```
## Downloading files ## Downloading files
@ -54,31 +54,31 @@ unsubscribe();
```javascript ```javascript
firebase.storage() firebase.storage()
.ref('/files/1234') .ref('/files/1234')
.downloadFile('/path/to/save/file') .downloadFile('/path/to/save/file')
.then(downloadedFile => { .then(downloadedFile => {
//success //success
}) })
.catch(err => { .catch(err => {
//Error //Error
}); });
``` ```
### Listen to download state ### Listen to download state
```javascript ```javascript
const unsubscribe = firebase.storage() const unsubscribe = firebase.storage()
.ref('/files/1234') .ref('/files/1234')
.downloadFile('/path/to/save/file') .downloadFile('/path/to/save/file')
.on('state_changed', snapshot => { .on('state_changed', snapshot => {
//Current download state //Current download state
}, err => { }, err => {
//Error //Error
unsubscribe(); unsubscribe();
}, downloadedFile => { }, downloadedFile => {
//Success //Success
unsubscribe(); unsubscribe();
}); });
``` ```
## TODO ## TODO