0.1.1 #2

Merged
Thilawyn merged 47 commits from next into master 2024-01-17 20:47:13 +01:00
3 changed files with 0 additions and 32 deletions
Showing only changes of commit 24a0e7098a - Show all commits

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