isolated constructor functions for entities and relations from config

This commit is contained in:
dswbx
2024-12-19 08:16:47 +01:00
parent 1d1ebff64d
commit d7ee13011f
6 changed files with 53 additions and 51 deletions

View File

@@ -1,6 +1,5 @@
import { Type, TypeInvalidError, parse, transformObject } from "core/utils";
import type { Entity } from "data";
import { AppData } from "data/AppData";
import { constructEntity } from "data";
import {
type TAppDataEntity,
type TAppDataEntityFields,
@@ -19,7 +18,7 @@ export function useBkndData() {
// @todo: potentially store in ref, so it doesn't get recomputed? or use memo?
const entities = transformObject(config.data.entities ?? {}, (entity, name) => {
return AppData.constructEntity(name, entity);
return constructEntity(name, entity);
});
const actions = {