Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

react-native-async-storage

vermilion115.4kMIT0.0.1

An abstraction on top of react-native's AsyncStorage

react-native, AsyncStorage

readme

React Native AsyncStorage (WIP)

An abstraction on top of react-native's AsyncStorage.

TODO

  • Add docs
  • Add tests for the storage.js

Simple example

ReactNativeAsyncStorage.using('model_name')
  .then((model) => {
    model.get(id);
    model.find();
    model.add({field1: 'value'});
    model.add([{field2: 'value'}, {field3: 'value'}]);
    model.save()
      .then(() => {
        console.log('Model has been saved');
      })
      .catch((err) => console.log('Oops...', err));
  })
  .catch((err) => console.log('Oops...', err));