(projection: Readonly<Projection<TodoListProjection>>)
| 200 | ); |
| 201 | |
| 202 | const processListProjection = (projection: Readonly<Projection<TodoListProjection>>) => { |
| 203 | const list = pipe( |
| 204 | projection.data, |
| 205 | Option.getOrElse(() => ({ todos: [] as const })) |
| 206 | ); |
| 207 | |
| 208 | return handleConditional( |
| 209 | list.todos, |
| 210 | formatTodoList(list.todos), |
| 211 | Console.log('No TODOs yet. Create one with: bun run src/cli.ts create "My task"') |
| 212 | ); |
| 213 | }; |
| 214 | |
| 215 | const listTodos = () => pipe(loadTodoListProjection(), Effect.flatMap(processListProjection)); |
| 216 |
nothing calls this directly
no test coverage detected