@athrok/react-native-mmkv
v0.0.1-alpha
Published
React Native MMKV persistence wrapper for Athrok state management library.
Downloads
3
Maintainers
Readme
@athrok/react-native-mmkv
React Native MMKV Persistence Wrapper for Athrok State Management Library
Introduction
@athrok/react-native-mmkv
is a utility package that provides seamless integration between React Native's MMKV and Athrok state management library. This package offers a convenient way to persist application state managed by Athrok using MMKV, a fast key-value storage library for React Native.
Features
- Adapts MMKV storage methods to conform to Athrok's state persistence requirements.
- Allows easy integration of MMKV 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-mmkv
via npm or yarn:
npm install @athrok/react-native-mmkv
or
yarn add @athrok/react-native-mmkv
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-mmkv
, follow these steps:
- Import the necessary modules:
import React from "react";
import { PersistenceProvider } from "@athrok/react-native-mmkv";
- 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 MMKV 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-mmkv
are welcome! Feel free to submit bug reports, feature requests, or pull requests on GitHub.
License
This project is licensed under the MIT License.