const getCredentials = Effect.fn(function*(userId){
return yield* ...
})
const make = Effect.fn(function*(userId) {
const client = Client.initWithMiddleware({
token: () => getCredentials(userId) // getCredentials return an Effect.Effect<string> but the `token` property expects a function that returns a string,
}) // I can use Effect.runPromise(getCredentials(userId)) but that doesnt seem good to run an effect inside a "running effect"
...
})
const getCredentials = Effect.fn(function*(userId){
return yield* ...
})
const make = Effect.fn(function*(userId) {
const client = Client.initWithMiddleware({
token: () => getCredentials(userId) // getCredentials return an Effect.Effect<string> but the `token` property expects a function that returns a string,
}) // I can use Effect.runPromise(getCredentials(userId)) but that doesnt seem good to run an effect inside a "running effect"
...
})