Skip to content
An asynchronous, persistent, key-value storage system for React Native.
Branch: master
Clone or download
semantic-release-bot chore(release): 1.3.3 [skip ci]
## [1.3.3](v1.3.2...v1.3.3) (2019-04-15)

### Bug Fixes

* Exclude headers from iOS archive. ([#77](#77)) ([562452c](562452c))
Latest commit c57cbeb Apr 15, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci chore: Setup semantic releases on master (#71) Apr 11, 2019
.github
android fix: do not throw on empty key list Feb 27, 2019
docs fix: failing to find headers when linked with Pods. (#75) Apr 14, 2019
example feat: Allow brownfield iOS apps to handle storage. (#35) Apr 10, 2019
ios fix: Exclude headers from iOS archive. (#77) Apr 15, 2019
jest feat: Jest mocks, testing guidelines Apr 8, 2019
lib fix: Deprecate AsyncStorage from React Native (#66) Apr 9, 2019
types fix: update TS types for multiGet Apr 6, 2019
.eslintrc
.flowconfig
.gitignore
.npmignore
.prettierrc
.releaserc
CONTRIBUTING.md chore: Setup semantic releases on master (#71) Apr 11, 2019
LICENSE Module scaffolding Feb 10, 2019
README.md
RNCAsyncStorage.podspec
babel.config.js feat: add custom hooks Feb 27, 2019
package.json
yarn.lock

README.md

React Native Async Storage

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.

Note: For iOS project using pods, run: $ cd ios/ && pod install

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, and brownfield integration guide.

Writing tests

Using Jest for testing? Make sure to check out docs on how to integrate it with this module.

Contribution

See the CONTRIBUTING file for how to help out.

License

MIT

You can’t perform that action at this time.