From f5dae50a5cfb8a84fdb948a61ed84600f3c75a7a Mon Sep 17 00:00:00 2001 From: Tim Glasgow Date: Sat, 30 Jul 2022 17:31:04 -0500 Subject: [PATCH] remove class structure for db api --- squarenotsquare/src/realm/dbAPI.js | 34 ++++++++++-------------------- 1 file changed, 11 insertions(+), 23 deletions(-) diff --git a/squarenotsquare/src/realm/dbAPI.js b/squarenotsquare/src/realm/dbAPI.js index 60f506f..24d77d8 100644 --- a/squarenotsquare/src/realm/dbAPI.js +++ b/squarenotsquare/src/realm/dbAPI.js @@ -1,29 +1,17 @@ import {systemRepo, userRepo, scoreRepo} from './dbInit'; -class realmAPI { - constructor(){ - if (realmDB === null) { - realmDB = this; - } - - return realmDB; - } - - getAllSystemValues() { - return systemRepo.getAllSystemValues(); - } +export function getAllSystemValues() { + return systemRepo.getAllSystemValues(); +} - createSystemValue(key, value) { - systemRepo.createSystemValue(key, value); - } - - deleteSystemValue(key) { - systemRepo.deleteSystemValue(key); - } +export function createSystemValue(key, value) { + systemRepo.createSystemValue(key, value); +} - getSystemValue(key) { - return systemRepo.getSystemKeyValue(key); - } +export function deleteSystemValue(key) { + systemRepo.deleteSystemValue(key); } -export let realmDB = new realmAPI(); \ No newline at end of file +export function getSystemValue(key) { + return systemRepo.getSystemKeyValue(key); +} \ No newline at end of file