Skip to content

Commit 0e5d775

Browse files
author
Krzysztof Borowy
committed
feat: scaffold basic docs
1 parent 1d92a52 commit 0e5d775

File tree

3 files changed

+54
-11
lines changed

3 files changed

+54
-11
lines changed

README.md

Lines changed: 48 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,61 @@
1-
# react-native-async-storage
1+
# React Native Async Storage
22

3-
Asynchronous, persistent, key-value storage system for React Native.
3+
An asynchronous, persistent, key-value storage system for React Native.
44

5-
## Getting started
65

6+
## Getting Started
77

8-
### Install
98

10-
`yarn add @react-native-community/async-storage`
9+
```
10+
# Install
11+
$ yarn add @react-native-community/async-storage
1112
12-
or
13+
# Link
14+
$ react-native link @react-native-community/async-storage
15+
```
1316

14-
`npm install @react-native-community/async-storage --save`
17+
See docs for [manual linking guide.](docs/Linking.md)
1518

1619

17-
### Link
20+
## Usage
1821

19-
`react-native link @react-native-community/async-storage`
22+
### Import
2023

21-
## Usage
24+
```js
25+
import AsyncStorage from '@react-native-community/async-storage';
26+
```
27+
28+
### Store data
29+
```jsx
30+
31+
storeData = async () => {
32+
try {
33+
await AsyncStorage.setItem('@storage_Key', 'stored value')
34+
} catch (e) {
35+
// saving error
36+
}
37+
}
38+
39+
```
40+
41+
### Read data
42+
```jsx
43+
44+
getData = async () => {
45+
try {
46+
const value = await AsyncStorage.getItem('@storage_Key')
47+
if(value !== null) {
48+
// value previously stored
49+
}
50+
} catch(e) {
51+
// error reading value
52+
}
53+
}
54+
55+
```
56+
57+
See docs for [api and more examples.](docs/API.md)
2258

23-
ToDo
59+
## License
2460

61+
MIT

docs/API.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Async Storage API

docs/Linking.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Manual Linking
2+
3+
## iOS
4+
5+
## Android

0 commit comments

Comments
 (0)