Implementing Effect Service to Return a String

Is it somehow possible to implement an effect service that returns a single
string
with Effect.Service, or does Service require returning an object?

import { Config, Effect } from "effect";

export class PokeApiUrl extends Effect.Service<PokeApiUrl>()("PokeApiUrl", {
  effect: Effect.gen(function* () {
    const baseUrl = yield* Config.string("BASE_URL");
    return `${baseUrl}/api/v2/pokemon`;
  })
}) {}
2024-10-09_18.27.32.png
Was this page helpful?