@athrok/react-native-async-storage
TypeScript icon, indicating that this package has built-in type declarations

0.0.1-alpha • Public • Published

@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-storage

or

yarn add @athrok/react-native-async-storage

Peer Dependencies: Make sure you have athrok installed as a peer dependency.

npm install athrok

or

yarn add athrok

Usage

To use @athrok/react-native-async-storage, follow these steps:

  1. Import the necessary modules:
import React from "react";
import { PersistenceProvider } from "@athrok/react-native-async-storage";
  1. 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.

Package Sidebar

Install

npm i @athrok/react-native-async-storage

Weekly Downloads

1

Version

0.0.1-alpha

License

MIT

Unpacked Size

12.2 kB

Total Files

7

Last publish

Collaborators

  • shetealok