Skip to content

Commit

Permalink
Replace calls to helper method w/ inline logic.
Browse files Browse the repository at this point in the history
  • Loading branch information
elle-j committed Jul 3, 2023
1 parent 66d5ada commit a6d3da5
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions packages/realm/src/Realm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ export class Realm {
public readonly syncSession: SyncSession | null;

private schemaExtras: RealmSchemaExtra = {};
private classes!: ClassMap;
private classes: ClassMap;
private changeListeners = new RealmListeners(this, RealmEvent.Change);
private beforeNotifyListeners = new RealmListeners(this, RealmEvent.BeforeNotify);
private schemaListeners = new RealmListeners(this, RealmEvent.Schema);
Expand Down Expand Up @@ -661,7 +661,7 @@ export class Realm {
},
schemaDidChange: (r) => {
r.verifyOpen();
this.updateClassMap();
this.classes = new ClassMap(this, this.internal.schema, this.schema);
this.schemaListeners.notify(this.schema);
},
beforeNotify: (r) => {
Expand All @@ -687,7 +687,7 @@ export class Realm {
writable: false,
});

this.updateClassMap();
this.classes = new ClassMap(this, this.internal.schema, this.schema);

const syncSession = this.internal.syncSession;
this.syncSession = syncSession ? new SyncSession(syncSession) : null;
Expand Down Expand Up @@ -1244,13 +1244,6 @@ export class Realm {
return this.classes.getHelpers<T>(arg);
}

/**
* @internal
*/
private updateClassMap() {
this.classes = new ClassMap(this, this.internal.schema, this.schema);
}

/**
* Update subscriptions with the initial subscriptions if needed.
* @param initialSubscriptions The initial subscriptions.
Expand Down

0 comments on commit a6d3da5

Please sign in to comment.