Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

Realm JS opening all Schemas in app. Bad practice?

$
0
0

I would like to create a utility class for Realm for my application, keeping most of the complexity with Realm in this class. To make life easier I proposed when opening a Realm instance I open all schemas within the app. As shown below:

export default class RealmAccess {    private realm!: Realm;    private allSchemas = [OneSchema, TwoSchema, ThreeSchema ... ];    private async open(schemaList: ObjectSchema[] = this.allSchemas): Promise<void> {        this.realm = await open({ schema: schemaList });    }}

Would this be considered bad practice?

Would this affect app performance at all when fetching/saving data? As an example we can assume each schema has a minimum of 500 rows.

I can't seem to find anything in the docs about this.


Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>