import { trait } from "@thilawyn/thilatrait" import { mapValues } from "lodash-es" import { makeObservable } from "mobx" import { z } from "zod" export const ObservableSchemable = trait(Parent => { abstract class ObservableSchemable extends Parent { abstract readonly schema: z.ZodObject< z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, z.objectOutputType, z.objectInputType > // constructor(...args: any[]) { // super(...args) // makeObservable(this, // mapValues(this.schema.shape, () => observable) as AnnotationsMap<$Config["values"], never> // ) // } } return ObservableSchemable })