Created
December 6, 2023 11:16
-
-
Save mohanmanu484/55b0356c088829c46dd7e09e2135bfd2 to your computer and use it in GitHub Desktop.
Auto saver
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 <T> autoSaver(): Saver<T, Any> = | |
| @Suppress("UNCHECKED_CAST") | |
| (AutoSaver as Saver<T, Any>) | |
| private val AutoSaver = Saver<Any?, Any>( | |
| save = { it }, | |
| restore = { it } | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment