Skip to content

Class for deal with Realm local DB similar to RN AsyncStorage

Notifications You must be signed in to change notification settings

app-masters/realm-async-storage

Repository files navigation

Realm Async Storage

Class for deal with Realm local DB similar to RN AsyncStorage

Usage

On the App.js, import and give desired model list to setup.

import {RealmStorage} from 'realm-async-storage';
...
const schemas = [UserSchema, CompanySchema]; // Realm schemas
const onError = (error) => console.error(error); // optional
RealmStorage.setup(schemas, onError)

Methods

  • setup (schemas?: Array): any
  • createItem (key: string, value: Object): Object
  • updateItem (key: string, value: Object): Object
  • deleteItem (item: RealmObject): Promise
  • getItems (key: string, filter: Object | string): Promise<Array | null>
  • removeAll (key: string): Promise
  • convertFilter (filter: Object | string): string
  • checkSchema (key: string)
  • getAllKeys (): Promise<Array>
  • getModel (): any
  • Using

About

Class for deal with Realm local DB similar to RN AsyncStorage

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published