react-native-async-storage

Introduction: An asynchronous, persistent, key-value storage system for React Native.
More: Author   ReportBugs   
Tags:

An asynchronous, persistent, key-value storage system for React Native.

Getting Started

# Install
$ yarn add @react-native-community/async-storage

# Link
$ react-native link @react-native-community/async-storage

See docs for manual linking guide.

Usage

Import

import AsyncStorage from '@react-native-community/async-storage';

Store data


storeData = async () => {
  try {
    await AsyncStorage.setItem('@storage_Key', 'stored value')
  } catch (e) {
    // saving error
  }
}

Read data


getData = async () => {
  try {
    const value = await AsyncStorage.getItem('@storage_Key')
    if(value !== null) {
      // value previously stored
    }
  } catch(e) {
    // error reading value
  }
}

See docs for api and more examples.

Contribution

See the CONTRIBUTING file for how to help out.

License

MIT

Support Me
Apps
About Me
Google+: Trinea trinea
GitHub: Trinea