This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fun main() { | |
| val descricao = "Inline te dando poderes mágicos" | |
| executarOperacao { | |
| print(descricao) | |
| } | |
| } | |
| fun executarOperacao(operacaoDois: () -> Unit) { | |
| operacaoUm() | |
| operacaoDois() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class SampleActivity : AppCompatActivity(R.layout.activity_sample) { | |
| private val viewModel by getViewModel { SampleViewModel(SingleLiveEvent()) } | |
| ... | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * This will recover and inject your interface in your fragments or activities | |
| */ | |
| inline fun <reified I, reified O> ComponentCallbacks.injectMapper(): Lazy<Mapper<I, O>> { | |
| return inject(named(identifier<I, O>())) | |
| } |
NewerOlder