interface Random {
readonly next: () => Effect.Effect<never, never, number>;
}
const Random = Context.Tag<Random>();
Effect.provideService(
Random,
// works
Random.of({ next: () => Effect.succeed(Math.random()) })
// just the value also works
// { next: () => Effect.succeed(Math.random()) }
)
interface Random {
readonly next: () => Effect.Effect<never, never, number>;
}
const Random = Context.Tag<Random>();
Effect.provideService(
Random,
// works
Random.of({ next: () => Effect.succeed(Math.random()) })
// just the value also works
// { next: () => Effect.succeed(Math.random()) }
)