Skip to content

Commit 53fd1a3

Browse files
committed
- Published 1.0.5 on Maven Central
1 parent 08313c8 commit 53fd1a3

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

flippable/src/main/java/com/wajahatkarim/flippable/FlippableController.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package com.wajahatkarim.flippable
22

3+
import androidx.compose.runtime.Composable
4+
import androidx.compose.runtime.remember
35
import kotlinx.coroutines.flow.MutableSharedFlow
46
import kotlinx.coroutines.flow.asSharedFlow
57

@@ -56,4 +58,14 @@ class FlippableController {
5658
) {
5759
_flipEnabled = flipEnabled
5860
}
61+
}
62+
63+
/**
64+
* Creates an instance of [FlippableController] and remembers it for recomposition.
65+
*/
66+
@Composable
67+
fun rememberFlipController(): FlippableController {
68+
return remember {
69+
FlippableController()
70+
}
5971
}

0 commit comments

Comments
 (0)