-
-
Save skydoves/b02a1371ad752bdc7d31de790664f39c to your computer and use it in GitHub Desktop.
RetainedEffectImpl
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
| private class RetainedEffectImpl( | |
| private val effect: RetainedEffectScope.() -> RetainedEffectResult | |
| ) : RetainObserver { | |
| private var onRetire: RetainedEffectResult? = null | |
| override fun onRetained() { | |
| onRetire = InternalRetainedEffectScope.effect() | |
| } | |
| override fun onRetired() { | |
| onRetire?.retire() | |
| onRetire = null | |
| } | |
| override fun onEnteredComposition() { | |
| // Do nothing. | |
| } | |
| override fun onExitedComposition() { | |
| // Do nothing. | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment