export const HttpApiGroupPokemonLive = (api: ApiType) =>
HttpApiBuilder.group(
api,
"pokemon",
(handlers) =>
Effect.gen(function*() {
yield* Effect.logDebug("PokemonGroupLive in memory")
const pokemonService = yield* PokemonService
return handlers
.handle("getById", ({ path }) => pokemonService.getById(path.id))
.handle("getAll", (_) => pokemonService.list())
})
)
export const HttpApiGroupPokemonLive = (api: ApiType) =>
HttpApiBuilder.group(
api,
"pokemon",
(handlers) =>
Effect.gen(function*() {
yield* Effect.logDebug("PokemonGroupLive in memory")
const pokemonService = yield* PokemonService
return handlers
.handle("getById", ({ path }) => pokemonService.getById(path.id))
.handle("getAll", (_) => pokemonService.list())
})
)