Skip to content

Commit

Permalink
docs(filesystem): use proper function syntax on examples (#292)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile authored Mar 3, 2021
1 parent ff5bb53 commit 168d692
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions filesystem/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Additionally, the Filesystem API supports using full `file://` paths, or reading
```typescript
import { Filesystem, Directory, Encoding } from '@capacitor/filesystem';

const writeSecretFile = async () {
const writeSecretFile = async () => {
await Filesystem.writeFile({
path: 'secrets/text.txt',
data: "This is a test",
Expand All @@ -29,7 +29,7 @@ const writeSecretFile = async () {
});
};

const readSecretFile = async () {
const readSecretFile = async () => {
const contents = await Filesystem.readFile({
path: 'secrets/text.txt',
directory: Directory.Documents,
Expand All @@ -39,14 +39,14 @@ const readSecretFile = async () {
console.log('secrets:', contents);
};

const deleteSecretFile = async () {
const deleteSecretFile = async () => {
await Filesystem.deleteFile({
path: 'secrets/text.txt',
directory: Directory.Documents,
});
};

const readFilePath = async () {
const readFilePath = async () => {
// Here's an example of reading a file with a full file path. Use this to
// read binary data (base64 encoded) from plugins that return File URIs, such as
// the Camera.
Expand Down

0 comments on commit 168d692

Please sign in to comment.