@ingenuity-labs/react-native-async-storage-wrapper
v1.0.3
Published
An Async Storage utility wrapper for React Native projects thru the initiative of Ingenuity Labs.
Downloads
2
Keywords
Readme
react-native-async-storage-wrapper
An Async Storage utility wrapper for React Native projects thru the initiative of Ingenuity Labs.
Installation
$ npm install --save @ingenuity-labs/react-native-async-storage-wrapper
Usage
AsyncStorage
is a collection of utility methods designed to simplify storing of an object to React Native's AsyncStorage
module. It is composed of three(3) methods.
getObjectWithIdentifier(identifier)
Retrieves the corresponding object of the provided
identifier
from the storage. It returns aPromise
object wherein the object is returned when resolve, else, you need to catch the error when it failed to fetch the object.
removeObjectWithIdentifier(identifier)
Removes the corresponding object of the provided
identifier
to the storage, else, you need to catch the error when it failed to remove the object.
setObjectWithIdentifier(object, identifier)
Stores the corresponding
object
with its givenidentifier
to the storage, else, you need to catch the error when it failed to store the object.
Contributing
- Fork repository
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request
License
MIT