rn-persistor is a lightweight and efficient package that seamlessly integrates Realm into your React Native applications, providing a robust solution for persistent data storage. This package simplifies the integration process and allows developers to focus on building engaging user experiences
npm install rn-persistor
Install the realm dependency
npm install realm
import RealmStorage from 'rn-persistor';
const realmStorage = new RealmStorage();
// For persistance
const persister = createAsyncStoragePersister({
storage: realmStorage, // pass to your storage option
});
// For Data storage
async function test() {
const key = 'token';
await realmStorage.setItem(key, JSON.stringify('abcdefsdf54s5df4ds5f'));
const persistedData = await realmStorage.getItem(key);
await realmStorage.removeItem(key);
}
test();
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
Made with create-react-native-library