Browse Source

export repo objects

pull/1/head
Tim Glasgow 2 years ago
parent
commit
7951555a03
  1. 13
      squarenotsquare/src/realm/dbInit.js

13
squarenotsquare/src/realm/dbInit.js

@ -18,9 +18,9 @@ import { migratev1 } from "./migrations/MigrateV1";
import {generateKey} from '../libs/Random';
import * as KeyStore from '../services/Keystore';
let systemRepo = null;
let scoreRepo = null;
let userRepo = null;
export let systemRepo = null;
export let scoreRepo = null;
export let userRepo = null;
export async function initDB(dbKeyRef = 'squareDB', dbLocation = Realm.defaultPath){
try {
@ -65,9 +65,12 @@ export async function initDB(dbKeyRef = 'squareDB', dbLocation = Realm.defaultPa
userRepo = new UserRepo(dbRef);
scoreRepo = new ScoreRepo(dbRef);
return dbRef;
return {
systemRepo: systemRepo,
userRepo: userRepo,
scoreRepo: scoreRepo
};
} catch (err) {
console.log(err);
return null;
}
}
Loading…
Cancel
Save