I would like to define two implicit parameters in the apply method as the following:
object WsGraph {
def apply(logger: Logger, sink: Sink[Message, Future[Done]])
(implicit system: ActorSystem, implicit executor: ExecutionContextExecutor) {
}
}
But the compiler does not allow this. How to do it correctly?
You just need to add one keyword implicit at the beginning of the second argument list and all arguments on it will be implicit:
object WsGraph {
def apply(logger: Logger, sink: Sink[Message, Future[Done]])
(implicit system: ActorSystem, executor: ExecutionContextExecutor) {
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With