react-native-storage-wrapper
A wrapper for React-Native's AsyncStorage.
Install
npm i --save react-native-storage-wrapper
Usage
; storage; // --> returns a Promise storage; // --> returns a Promise storage; // --> returns a Promise
asteroid
Usage with ;; const Asteroid = ;// Connect to a Meteor backendconst asteroid = endpoint: "ws://localhost:3000/websocket" storage: storage;
API
.get("key")
Fetches key from AsyncStorage
with method getItem
.
Arguments
key
String required:key
to fetch inAsyncStorage
Returns
A Promise
object. If there is any, throw an Error
.set("key", "value")
Sets value for key from AsyncStorage
with method setItem
.
Arguments
-
key
String required:key
saved inAsyncStorage
-
value
String required:value
saved inAsyncStorage
.del("key")
Remove item with selected key
from AsyncStorage
with method removeItem
.
Arguments
key
String required:key
to remove fromAsyncStorage