Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for tupled results in autowire #194

Open
mbore opened this issue Jan 11, 2022 · 0 comments
Open

Add support for tupled results in autowire #194

mbore opened this issue Jan 11, 2022 · 0 comments
Labels

Comments

@mbore
Copy link
Contributor

mbore commented Jan 11, 2022

Currently, to create more than one instance in autowire we need to define a helper case class that wraps target instances (e.g. https://github.com/softwaremill/bootzooka/pull/766/files#diff-a9ca80cae7dddc8a64f16da196fc18bf18aff6cbaa4a996a872c0228d1eaddc5R21)
We should be able to return tupled result instances instead.
Test case:

case class A()
case class B()

object Test {
  val tuple = autowire[(A, B)]()
}

val tuple: (A, B) = {
  import cats.effect.unsafe.implicits.global
  Test.tuple.allocated.unsafeRunSync()._1
}

require(tuple._1 == A())
require(tuple._2 == B())
@mbore mbore added the autowire label Jan 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant