MCPcopy Create free account
hub / github.com/Effect-TS/effect / createTodo

Function createTodo

packages/effect/test/HttpClient.test.ts:27–32  ·  view source on GitHub ↗
(todo: typeof TodoWithoutId.Type)

Source from the content-addressed store, hash-verified

25const makeJsonPlaceholder = Effect.gen(function*() {
26 const client = yield* HttpClient.HttpClient
27 const createTodo = (todo: typeof TodoWithoutId.Type) =>
28 HttpClientRequest.post("/todos").pipe(
29 HttpClientRequest.schemaBodyJson(TodoWithoutId)(todo),
30 Effect.flatMap(client.execute),
31 Effect.flatMap(HttpClientResponse.schemaBodyJson(Todo))
32 )
33 return {
34 client,
35 createTodo

Callers

nothing calls this directly

Calls 1

pipeMethod · 0.65

Tested by

no test coverage detected