Shortcut for Applying Arguments to Services Returning Effects in Pipelines

When I have a service that's a function that returns an effect, is there a shortcut for accessing the service and applying some value?

In the generator syntax, seeing:

const someService = yield* SomeTag
yield* someService(someInput)


is common. In a pipeline, though, it seems a bit awkward, needing:

SomeTag.pipe(Effect.andThen(Function.apply(someInput))
// or
Effect.flatMap(SomeTag, Function.apply(someInput))


While I could extract a helper function for each service, is there some generic way to apply an argument to an Effect containing a function that returns an Effect? Something like:

Effect.applyTo(someInput, SomeTag)
// or
someOtherEffect.pipe(Effect.andThen(Effect.applyTo(SomeTag)))
Was this page helpful?