Skip to content

Commit

Permalink
fix error indent in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
plrthink committed May 20, 2016
1 parent da7169c commit d9aab49
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,13 @@ ZipArchive.unzip(sourcePath, targetPath)

> unzip file from Android `assets` folder to target path
Note: Android only.
*Note: Android only.*

`assetPath` is the relative path to the file inside the pre-bundled assets folder, e.g. `folder/myFile.zip`. Do not pass an absolute directory.

```js
let assetPath = 'folder/myFile.zip'
let targetPath = RNFS.DocumentDirectoryPath
const assetPath = 'folder/myFile.zip'
const targetPath = RNFS.DocumentDirectoryPath

ZipArchive.unzipAssets(assetPath, targetPath)
.then(() => {
Expand All @@ -131,21 +131,21 @@ ZipArchive.unzipAssets(assetPath, targetPath)

> Subscribe to unzip progress callbacks. Useful for displaying a progress bar on your UI during the unzip process.
Your callback will passed an object with the following fields:
Your callback will be passed an object with the following fields:

- `progress` (number) a value from 0 to 1 representing the progress of the unzip method. 1 is completed.

Note: Remember to unsubscribe! Run .remove() on the object returned by this method.
*Note: Remember to unsubscribe! Run .remove() on the object returned by this method.*

```js
componentWillMount() {
this.zipProgress = ZipArchive.subscribe((e)=>{
this.setState({zipProgress: e.progress})
});
this.zipProgress = ZipArchive.subscribe((e) => {
this.setState({ zipProgress: e.progress })
})
}

componentWillUnmount() {
// Important: Unsubscribe from the progress events
this.zipProgress.remove()
// Important: Unsubscribe from the progress events
this.zipProgress.remove()
}
```
```

0 comments on commit d9aab49

Please sign in to comment.