Browse Source

remove class structure for db api

pull/1/head
Tim Glasgow 2 years ago
parent
commit
f5dae50a5c
  1. 34
      squarenotsquare/src/realm/dbAPI.js

34
squarenotsquare/src/realm/dbAPI.js

@ -1,29 +1,17 @@
import {systemRepo, userRepo, scoreRepo} from './dbInit'; import {systemRepo, userRepo, scoreRepo} from './dbInit';
class realmAPI { export function getAllSystemValues() {
constructor(){ return systemRepo.getAllSystemValues();
if (realmDB === null) { }
realmDB = this;
}
return realmDB;
}
getAllSystemValues() {
return systemRepo.getAllSystemValues();
}
createSystemValue(key, value) {
systemRepo.createSystemValue(key, value);
}
deleteSystemValue(key) { export function createSystemValue(key, value) {
systemRepo.deleteSystemValue(key); systemRepo.createSystemValue(key, value);
} }
getSystemValue(key) { export function deleteSystemValue(key) {
return systemRepo.getSystemKeyValue(key); systemRepo.deleteSystemValue(key);
}
} }
export let realmDB = new realmAPI(); export function getSystemValue(key) {
return systemRepo.getSystemKeyValue(key);
}
Loading…
Cancel
Save