Skip to content

Commit da05f70

Browse files
author
Krzysztof Borowy
committed
docs: installation guides
1 parent a5bf325 commit da05f70

File tree

5 files changed

+49
-14
lines changed

5 files changed

+49
-14
lines changed

README.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,28 @@ If you're looking for published and operational Async Storage version, please ch
1515
- Extensible functionality, to leverage full storage potential
1616
- Support for Mobile, Web and more
1717

18-
1918
## Getting started
2019

21-
Quick introduction to AsyncStorage can [be found here.](./packages/core/docs/Usage.md)
20+
### Install
21+
22+
1. Get required core
23+
24+
```bash
25+
yarn add @react-native-community/async-storage@next
26+
```
27+
28+
2. Pick desired [storage for your platform.](#available-storages)
29+
30+
31+
### Usage
32+
33+
Example usage [be found here.](./packages/core/docs/Usage.md)
2234

2335

2436
## Available storages
2537

26-
- [Legacy](./packages/storage-legacy/README.md)
27-
- [Web](./packages/storage-web/README.md)
38+
- [Legacy](./packages/storage-legacy/README.md) - for React Native
39+
- [Web](./packages/storage-web/README.md) - for Web applications
2840

2941

3042
## Documentation

packages/core/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Async Storage Core
22

3-
Main, public-facing components of Async Storage. The core module contains a factory to create an `AsyncStorage` instance
3+
Main, public-facing components of Async Storage. Contains a factory to create an `AsyncStorage` instance
44
and `IStorageBackend`, that needs to be implemented by any Backend Storage in order to be compatible.
55

66
## Install
77

88
```bash
9-
$ yarn install @react-native-community/async-storage
9+
$ yarn install @react-native-community/async-storage@next
1010
```
1111

1212
## API

packages/core/docs/Usage.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ In this example, we'll be using [Legacy storage](https://github.com/react-native
1515

1616
```bash
1717
# Install core
18-
$ yarn add @react-native-community/async-storage
18+
$ yarn add @react-native-community/async-storage@next
1919

2020
# Install legacy backend storage
21-
$ yarn add @react-native-community/async-storage-backend-legacy
21+
$ yarn add @react-native-community/async-storage-backend-legacy@next
2222
```
2323

2424

packages/storage-legacy/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ An `AsyncStorage` storage backend, fully compatible with former version.
66

77

88
```bash
9-
$ yarn add @react-native-community/async-storage-backend-legacy
9+
$ yarn add @react-native-community/async-storage-backend-legacy@next
1010
```
1111

1212

@@ -32,4 +32,4 @@ export default storage;
3232

3333
## License
3434

35-
MIT
35+
MIT.

packages/storage-web/README.md

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,38 @@
11
# Storage Backend: Web
22

3-
// todo
3+
An AsyncStorage backend, targeting web platform. Uses either [`localStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage) or [`sessionStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage).
44

55
## Installation
66

7-
// todo
7+
```bash
8+
$ yarn add @react-native-community/async-storage@next
9+
10+
$ yarn add @react-native-community/async-storage-backend-web@next
11+
```
812

913
## Usage
1014

11-
// todo
15+
```typescript
16+
17+
import WebStorage from '@react-native-community/async-storage-backend-web';
18+
import AsyncStorageFactory from '@react-native-community/async-storage';
19+
20+
type MyModel = {};
21+
22+
23+
const webStorage = new WebStorage(true);
24+
25+
const storage = AsyncStorageFactory.create<MyModel>(webStorage);
26+
27+
28+
export default storage;
29+
```
30+
31+
## Options
32+
33+
`WebStorage` accepts a single `boolean` argument, deciding if `sessionStorage` should be used instead of `localStorage`. Default is `false`.
34+
1235

1336
## License
1437

15-
MIT
38+
MIT.

0 commit comments

Comments
 (0)