Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/app-masters/realm-async-storage
Class for deal with Realm local DB similar to RN AsyncStorage
https://github.com/app-masters/realm-async-storage
Last synced: 8 days ago
JSON representation
Class for deal with Realm local DB similar to RN AsyncStorage
- Host: GitHub
- URL: https://github.com/app-masters/realm-async-storage
- Owner: app-masters
- Created: 2018-10-16T12:20:34.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-10-26T13:39:39.000Z (about 6 years ago)
- Last Synced: 2024-08-11T00:05:23.413Z (3 months ago)
- Language: JavaScript
- Size: 26.4 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# 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.
````javascript
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 | null>
- removeAll (key: string): Promise
- convertFilter (filter: Object | string): string
- checkSchema (key: string)
- getAllKeys (): Promise>
- getModel (): any### Using
- [Realm-JS 2.18.0](https://github.com/realm/realm-js)