0.3.2 • Published 3 months ago

rn-persistor v0.3.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

rn-persistor

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

Installation

npm install rn-persistor

Install the realm dependency

npm install realm

Usage

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();

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

0.3.2

3 months ago

0.3.0

3 months ago

0.3.1

3 months ago

0.2.0

3 months ago

0.1.0

3 months ago