realm-async-storage

0.0.1 • Public • Published

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];
const onError = (error) => console.error(error); // optional
RealmStorage.setup(setup, 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

/realm-async-storage/

    Package Sidebar

    Install

    npm i realm-async-storage

    Weekly Downloads

    4

    Version

    0.0.1

    License

    none

    Unpacked Size

    20.8 kB

    Total Files

    9

    Last publish

    Collaborators

    • baraky