Cleanup
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Julien Valverdé
2024-01-17 20:00:51 +01:00
parent 6d1eddae55
commit 24a0e7098a
3 changed files with 0 additions and 32 deletions

View File

@@ -1,27 +0,0 @@
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.ZodRawShape, z.ZodTypeAny, z.UnknownKeysParam>,
z.objectInputType<z.ZodRawShape, z.ZodTypeAny, z.UnknownKeysParam>
>
// constructor(...args: any[]) {
// super(...args)
// makeObservable(this,
// mapValues(this.schema.shape, () => observable) as AnnotationsMap<$Config["values"], never>
// )
// }
}
return ObservableSchemable
})

View File

@@ -1 +0,0 @@
export * from "./ObservableSchemable"

View File

@@ -2,8 +2,6 @@ import { pipeInto } from "ts-functional-pipe"
import { z } from "zod" import { z } from "zod"
import { defineDefaultValues, extendSchemableClass, makeSchemableClass, newSchemable } from "." import { defineDefaultValues, extendSchemableClass, makeSchemableClass, newSchemable } from "."
import { dejsonifyBigIntSchema, dejsonifySchemable, jsonifyBigIntSchema, makeJsonifiableSchemableClass } from "./jsonifiable" import { dejsonifyBigIntSchema, dejsonifySchemable, jsonifyBigIntSchema, makeJsonifiableSchemableClass } from "./jsonifiable"
import { extendsAndExpresses } from "@thilawyn/thilatrait"
import { ObservableSchemable } from "./observable"
const UserLevel = z.enum(["User", "Admin"]) const UserLevel = z.enum(["User", "Admin"])
@@ -31,8 +29,6 @@ class User extends pipeInto(
id: dejsonifyBigIntSchema(shape.id) id: dejsonifyBigIntSchema(shape.id)
}), }),
}), }),
v => extendsAndExpresses(v, ObservableSchemable),
) {} ) {}
User.schema User.schema