Work
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { BunRuntime } from "@effect/platform-bun"
|
||||
import { Todo } from "@todo-tests/common/data"
|
||||
import { Identifiable } from "@todo-tests/common/traits"
|
||||
import { Array, Duration, Effect, Layer, Option, Stream } from "effect"
|
||||
import { Array, Effect, Layer, Option, Stream } from "effect"
|
||||
import { ServicesLive } from "./Services"
|
||||
import { TodoRepository, createDefaultTodos } from "./TodoRepository"
|
||||
import { ExpressApp } from "./express/ExpressApp"
|
||||
@@ -41,10 +41,10 @@ const watchTodoChanges = Effect.gen(function*() {
|
||||
})
|
||||
|
||||
const main = Effect.gen(function*() {
|
||||
const watcher = yield* Effect.fork(watchTodoChanges)
|
||||
// const watcher = yield* Effect.fork(watchTodoChanges)
|
||||
yield* createDefaultTodos
|
||||
|
||||
const todos = yield* TodoRepository
|
||||
// const todos = yield* TodoRepository
|
||||
|
||||
// const secondTodo = yield* yield* todos.todos.get.pipe(
|
||||
// Effect.map(Array.get(1))
|
||||
@@ -55,17 +55,17 @@ const main = Effect.gen(function*() {
|
||||
// })
|
||||
// yield* todos.update(secondTodoModified)
|
||||
|
||||
yield* todos.add(new Todo({
|
||||
id: Option.none(),
|
||||
title: "Put the dishes in the dishwasher",
|
||||
content: "Lorem ipsum",
|
||||
due: Option.none(),
|
||||
completed: false,
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
})).pipe(
|
||||
Effect.delay(Duration.seconds(1))
|
||||
)
|
||||
// yield* todos.add(new Todo({
|
||||
// id: Option.none(),
|
||||
// title: "Put the dishes in the dishwasher",
|
||||
// content: "Lorem ipsum",
|
||||
// due: Option.none(),
|
||||
// completed: false,
|
||||
// createdAt: new Date(),
|
||||
// updatedAt: new Date(),
|
||||
// })).pipe(
|
||||
// Effect.delay(Duration.seconds(1))
|
||||
// )
|
||||
|
||||
// yield* Fiber.join(watcher)
|
||||
yield* Layer.launch(ServerLive)
|
||||
|
||||
Reference in New Issue
Block a user