Providing a service multiple times with different values within one Effect

Is it bad practice to provide a service multiple times with different values within 1 Effect?

For example:
const doMagic = Effect.fn("")(function* () {
  const api = yield* ApiService

  api.callMethod()
})

// Some fn
doMagic().pipe(Effect.provide(ApiService.Default("some-api-key"))

doMagic().pipe(Effect.provide(ApiService.Default("some-alternative-api-key")

Mostly asking, because in this case how would you deal with providing mock variants instead?
Was this page helpful?