Dependencies upgrade

This commit is contained in:
Julien Valverdé
2024-07-08 00:05:48 +02:00
parent b89ecc6526
commit 94c4e4e9f7
8 changed files with 55 additions and 10 deletions

View File

@@ -1,10 +1,14 @@
import { Index } from "./Index"
import "./index.css"
import { TRPCClientProvider } from "./trpc/TRPCClientProvider"
export function App() {
return (
<TRPCClientProvider>
<Index />
</TRPCClientProvider>
)
}

View File

@@ -0,0 +1,29 @@
import { Schema as S } from "@effect/schema"
import { JsonifiableTodo } from "@todo-tests/common/data"
import { Todo } from "./data"
import { trpc } from "./trpc/trpc"
const decodeTodos = S.decodeSync(
S.mutable(
S.Array(
JsonifiableTodo.pipe(S.compose(Todo))
)
)
)
export function Index() {
const todosQuery = trpc.todos.all.useQuery(undefined, { select: decodeTodos })
return <>
<div className="container mx-auto">
<p className="text-4xl text-center">Todos</p>
</div>
</>
}

View File

@@ -0,0 +1,9 @@
import { MobXObservable, MutableClass } from "@thilawyn/thilalib/effect/schema/class"
import { Todo as CommonTodo } from "@todo-tests/common/data"
export class Todo
extends MutableClass<Todo>("Todo")(CommonTodo.fields).pipe(
MobXObservable
)
{}

View File

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