hello! I am doing some programming with scala on android and I thought about using macwire. Everything works nicely but I got stuck with injecting class which depends on the other one extending module. Example:
class ChatPresenter(chatContractView: ChatContractView) extends ChatContractPresenter { }
trait ChatModule {
import com.softwaremill.macwire._
lazy val presenter: ChatContractPresenter = wire[ChatPresenter]
}
class ChatFragment extends BaseFragment with ChatModule { pesenter. ..... }
So I want to use ChatPresenter in ChatFragment. How can I achieve this ?
trait ChatModule {
import com.softwaremill.macwire._
def presenter(chatContractView: ChatContractView) : ChatContractPresenter = wire[ChatPresenter]
}
class ChatFragment extends BaseFragment
with ChatContractView
with ChatModule {
val chatPresenter = presenter(this)
}
DatabaseSetupAndTeardown.scala:30: Cannot find a public constructor nor a companion object for ...DatabaseProfile
lazy val dbProfile = wire[DatabaseProfile]
@Module
trait TestModule extends BackendCoreModule {
override lazy val dbProfile = H2TestProfile
}
Long
id of an entity with the type of the entity. Otherwise I'd say some kinds of wrapper objects