This PR introduces the method addProducer into CoroutinesSubtypeEffectHandlerBuilder.
This method is used to account for the cases where an Effect is consumed but ignored, like in the addAction method. But unlike the addAction method, and like the addFunction method, this new method is expected to produce an Event
The new method is particularly useful when you are using method references instead of lambdas. Previously if you wanted to produce an event, you were required to use addFunction and declare your function with an unused parameter.
Also, as a secondary minor task. I simplified the use of the annotation @ExperimentalCoroutinesApi in tests by moving it from every individual test to the test class.
This PR introduces the method
addProducer
intoCoroutinesSubtypeEffectHandlerBuilder
.This method is used to account for the cases where an
Effect
is consumed but ignored, like in theaddAction
method. But unlike theaddAction
method, and like theaddFunction
method, this new method is expected to produce anEvent
Here are all the methods illustrated:
The new method is particularly useful when you are using method references instead of lambdas. Previously if you wanted to produce an event, you were required to use
addFunction
and declare your function with an unused parameter.Also, as a secondary minor task. I simplified the use of the annotation
@ExperimentalCoroutinesApi
in tests by moving it from every individual test to the test class.