Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Michaelvilleneuve committed Sep 27, 2018
1 parent a527bf8 commit 27d8fca
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# react-native-fast-storage

react-native-fast-storage is a synchronous drop in replacement for `AsyncStorage`.
react-native-fast-storage is a drop in replacement for `AsyncStorage`.

This library is the React Native implementation of https://github.com/Tencent/MMKV.

It provides very fast read and write access.

## Getting started

Expand All @@ -13,7 +17,18 @@ react-native-fast-storage is a synchronous drop in replacement for `AsyncStorage
```javascript
import FastStorage from "react-native-fast-storage";

FastStorage.setItem("key", "Coucou toi");
await FastStorage.setItem("key", "Coucou toi");

const item = FastStorage.getItem("key"); // Coucou toi
const item = await FastStorage.getItem("key");
```

## Methods

All methods are asynchronous, just like AsyncStorage.

| Prop | Params | Returns | Description |
| :--------- | :-------------: | :------: | :----------------------------- |
| setItem |  `key`, `value` |  `value` |  Allows to set an item |
| getItem |  `key` |  `value` |  Retrieve the item |
| removeItem |  `key` |  null |  Remove an item from the store |
| clearStore |  none |  null |  Clear the entire store |

0 comments on commit 27d8fca

Please sign in to comment.