react-native-storer
v1.0.2
Published
Easy React Native storage.
Downloads
8
Maintainers
Readme
Storer
Easy React Native storage.
import { clearStorage, getStorage, setStorage } from 'react-native-storer';
Get a single key
const age = await getStorage('age');
Get multiple keys:
const { name, age } = await getStorage(['name', 'age']);
Set a single key:
await setStorage('age', 21);
Set multiple keys:
await setStorage({ name: 'Bob', age: 28 });
Set a key from a previous value:
await setStorage('friends', friends => ([...friends, 'Joe']));
Get all keys:
await getStorage();
Remove a key:
await setStorage('friends');
Clear all storage:
await clearStorage();