@athrok/react-native-async-storage v0.0.1-alpha
@athrok/react-native-async-storage
React Native AsyncStorage Persistence Wrapper for Athrok State Management Library
Introduction
@athrok/react-native-async-storage is a utility package that provides seamless integration between React Native's AsyncStorage and Athrok state management library. This package offers a convenient way to persist application state managed by Athrok across app sessions in a React Native environment.
Features
- Adapts React Native's AsyncStorage methods to conform to Athrok's state persistence requirements.
- Allows easy integration of AsyncStorage with Athrok's StorageManager for managing application state persistence.
- Provides a simple and straightforward API for asynchronous storage operations.
Installation
You can install @athrok/react-native-async-storage via npm or yarn:
npm install @athrok/react-native-async-storageor
yarn add @athrok/react-native-async-storagePeer Dependencies: Make sure you have athrok installed as a peer dependency.
npm install athrokor
yarn add athrokUsage
To use @athrok/react-native-async-storage, follow these steps:
- Import the necessary modules:
import React from "react";
import { PersistenceProvider } from "@athrok/react-native-async-storage";- Wrap your application's components with
PersistenceProvider:
export default function App() {
return (
<PersistenceProvider>
{
// Place your application's child components and data here
}
</PersistenceProvider>
);
}In this example, the PersistenceProvider component ensures that Athrok's AsyncStorage persistence is initialized and ready for use throughout the application. You can place your application's child components and data inside the PersistenceProvider component to manage the persistence of the application state across app sessions seamlessly.
Contributing
Contributions to @athrok/react-native-async-storage are welcome! Feel free to submit bug reports, feature requests, or pull requests on GitHub.
License
This project is licensed under the MIT License.
2 years ago