Skip to content

Commit 289e742

Browse files
author
Krzysztof Borowy
committed
docs: content change
1 parent cfcc09f commit 289e742

File tree

7 files changed

+60
-45
lines changed

7 files changed

+60
-45
lines changed

README.md

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

3-
A collection of persistent data storages, unified into a single API.
3+
A collection of persistent data storages, targeting different platforms, unified within a single API.
44

55
## Work in progress
66

77
Async Storage v2 is under development.
88

9-
If you're looking for published and operational Async Storage version, please check out [`LEGACY`](https://github.com/react-native-community/async-storage/tree/LEGACY) branch.
9+
If you're looking for published and operational Async Storage version, please check out [`LEGACY`](https://github.com/react-native-community/async-storage/tree/LEGACY) branch.
1010

1111
## Features
1212

13-
- Unified API to consume any supported storage
14-
- Different type of storage for different purpose, see [available storages](#available-storages)
15-
- Extensible functionality, to leverage full storage potential
16-
- Support for Mobile, Web and more
13+
- One, unified API to support different storages
14+
- [Extensible functionality](./packages/core/docs/API.md#extensions)
15+
- Targets Mobile, Web and more
16+
1717

1818
## Getting started
1919

2020
### Install
2121

22-
1. Get required core
22+
1. Install Core dependency
2323

2424
```bash
2525
yarn add @react-native-community/async-storage@next
2626
```
2727

28-
2. Pick desired [storage for your platform.](#available-storages)
28+
2. Select a [storage for your platform.](#available-storages)
2929

3030

3131
### Usage
3232

33-
Example usage can [be found here.](./packages/core/docs/Usage.md)
33+
See usage can [be found here.](./packages/core/docs/Usage.md)
3434

3535

3636
## Available storages
3737

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

4141

4242
## Documentation

examples/mobile/README.md

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
# Async Storage mobile examples
1+
# Async Storage - Mobile example
22

3-
## Running the example
3+
Example React Native app presenting features of [`async-storage-backend-legacy`](https://github.com/react-native-community/async-storage/tree/master/packages/storage-legacy).
44

5-
1. Get dependencies
5+
## Running the app
6+
7+
1. Install dependencies
68

79
```bash
810
$ yarn install
911
```
1012

11-
2. Install the app
13+
2. Run the app on either platform
1214

1315
```bash
1416
# Android
@@ -18,16 +20,9 @@ $ yarn start:android
1820
$ yarn start:ios
1921
```
2022

21-
3. Run packager
22-
23-
```bash
24-
$ yarn start
25-
```
26-
2723
## Feedback
2824

29-
Let me know about any issue found or feedback you have at [Async-Storage issue page](https://github.com/react-native-community/async-storage/issues).
30-
Please mark it as `examples` label.
25+
All feedback is welcome at [Async-Storage issue page](https://github.com/react-native-community/async-storage/issues).
3126

3227
## License
3328

examples/web/README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
1-
# Async Storage Web examples
1+
# Async Storage - Web example
22

3-
## Running the example
3+
Example React app presenting features of [`async-storage-backend-web`](https://github.com/react-native-community/async-storage/tree/master/packages/storage-web).
44

5-
1. Get dependencies
5+
## Running the app
6+
7+
1. Install dependencies
68

79
```bash
810
$ yarn install
911
```
1012

11-
2. Run application
13+
2. Run the app
1214

1315
```bash
1416
$ yarn start
1517
```
1618

1719
## Feedback
1820

19-
Let me know about any issue found or feedback you have at [Async-Storage issue page](https://github.com/react-native-community/async-storage/issues).
20-
Please mark it as `examples` label.
21+
All feedback is welcome at [Async-Storage issue page](https://github.com/react-native-community/async-storage/issues).
2122

2223
## License
2324

packages/core/docs/Usage.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
11
# Async Storage usage
22

3-
Async Storage is a collection of usable storage backends for your App.
3+
Async Storage is a collection of persistent storage for different platforms, with unified API.
44

5-
It comes in two parts: core and storage backend, you want to use.
5+
It comes in two parts: the core and storage itself.
66

7-
*Core* is a consumer of the storage, provides you a unified API to save and read data.
7+
*Core* - a consumer for the storage, provides a unified API to use it.
88

9-
*Storage backend* implements an interface that *core* API understands and uses. Its functionality depends on storage itself.
9+
*Storage backend* - platform-dependant implementation of persistent data storage.
1010

1111

1212
## Install necessary dependencies
1313

14-
In this example, we'll be using [Legacy storage](https://github.com/react-native-community/async-storage/tree/master/packages/storage-legacy).
14+
In this example, [Legacy storage](https://github.com/react-native-community/async-storage/tree/master/packages/storage-legacy) is used.
1515

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

22+
```bash
2023
# Install legacy backend storage
24+
2125
$ yarn add @react-native-community/async-storage-backend-legacy@next
2226
```
2327

@@ -35,6 +39,7 @@ const legacyStorage = new LegacyStorage();
3539
export type StorageModel = {
3640
user: {
3741
name: string
42+
age: number
3843
}
3944
}
4045

@@ -55,7 +60,8 @@ import storage from './storage.ts';
5560

5661
async function saveItem() {
5762
const myUser = {
58-
name: 'test'
63+
name: 'John',
64+
age: 22
5965
};
6066

6167
await storage.set('user', myUser);

packages/core/docs/Writing_Storage_Backend.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Authoring Storage Backend
22

3-
Async Storage is a [facade](https://en.wikipedia.org/wiki/Facade_pattern) over the underlying Storage solution.
3+
Async Storage is a [facade](https://en.wikipedia.org/wiki/Facade_pattern) over the underlying Storage solution.
44
In order for the new storage to be compatible, it has to implement `IStorageBackend` and its methods.
55

66

@@ -22,8 +22,8 @@ that simplifies access to the storage features. Those methods are:
2222
- `removeSingle` - removes an entry for provided `key`
2323
- `getMany` - returns an array of `values`, for a provided array of `keys`
2424
- `setMany` - provided an array of `key-value` pairs, saves them to the storage
25-
- `removeMany` - removes a bunch of values, for a provided array of `keys`
26-
- `getKeys` - returns an array of `keys` that were used to store values
25+
- `removeMany` - removes a bunch of values, for a provided array of `keys`
26+
- `getKeys` - returns an array of `keys` that were used to store values
2727
- `dropStorage` - purges the storage
2828

2929

@@ -34,7 +34,7 @@ Few points to keep in mind while developing new storage:
3434

3535

3636

37-
## Going being default API
37+
## Going beyond the default API
3838

3939
Unified API can be limiting - storages differ from each other and contain features that others do not. Async Storage comes with an extension property, that lets you extend its standard API.
4040

@@ -86,13 +86,13 @@ async function removeOldEntries() {
8686

8787
## Example
8888

89-
Let's create a storage backend for web, using `LocalStorage` API.
89+
Let's create a storage backend for web, using `LocalStorage` API.
9090

9191
Start by adding `AsyncStorage` to your dependencies.
9292

9393
```bash
9494
$ yarn add @react-native-community/async-storage
95-
```
95+
```
9696

9797
Then, create a class and implement `IStorageBackend` interface;
9898

packages/storage-legacy/README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
# Storage Backend: Legacy
22

3-
An `AsyncStorage` storage backend, fully compatible with former version.
3+
Storage backend for `Async Storage`, targeting Mobile platform (React-Native). Compatible with [former version of `Async Storage`](https://github.com/react-native-community/async-storage/tree/LEGACY/).
44

55
## Installation
66

7+
1. Get the core
8+
9+
```bash
10+
$ yarn add @react-native-community/async-storage@next
11+
```
12+
13+
2. Get the the storage
714

815
```bash
916
$ yarn add @react-native-community/async-storage-backend-legacy@next
@@ -12,7 +19,6 @@ $ yarn add @react-native-community/async-storage-backend-legacy@next
1219

1320
## Usage
1421

15-
1622
```typescript
1723

1824
import LegacyStorage from '@react-native-community/async-storage-backend-legacy';
@@ -26,7 +32,7 @@ const legacyStorage = new LegacyStorage();
2632

2733
const storage = AsyncStorageFactory.create<MyModel>(legacyStorage);
2834

29-
// ready to use
35+
3036
export default storage;
3137
```
3238

packages/storage-web/README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
11
# Storage Backend: Web
22

3-
Storage backend for `AsyncStorage`, targeting Web platform.
3+
Storage backend for `Async Storage`, targeting Web platform.
44

55
## Installation
66

7+
1. Get the core
8+
79
```bash
810
$ yarn add @react-native-community/async-storage@next
11+
```
12+
13+
2. Get the the storage
914

15+
```bash
1016
$ yarn add @react-native-community/async-storage-backend-web@next
1117
```
1218

19+
1320
## Usage
1421

1522
```typescript

0 commit comments

Comments
 (0)