diff --git a/README.md b/README.md index ac3dcc8..2b8e195 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 |