Skip to content

Instantly share code, notes, and snippets.

View mattrob33's full-sized avatar

Matt Robertson mattrob33

View GitHub Profile
inline fun Modifier.clickable(crossinline onClick: () -> Unit): Modifier = composed {
clickable(
indication = rememberRipple(),
interactionSource = remember { MutableInteractionSource() }
) {
onClick()
}
}
@mattrob33
mattrob33 / rememberStateUsage.kt
Created June 14, 2023 01:42
rememberState usage
@Composable fun Screen(
url: String
) {
var count by rememberState { 0 }
val content by rememberState(url) { load(url) }
}
@mattrob33
mattrob33 / rememberState.kt
Created June 14, 2023 01:34
rememberState
/**
* Shorthand for
*
* ```
* remember {
* mutableStateOf(...)
* }
* ```
*/
@Composable
///
/// A subclass of ``XCTestCase`` that supports async setup and teardown.
///
class XCAsyncTestCase: XCTestCase {
func asyncSetUpWithError() async throws {
fatalError("Must override")
}
func asyncTearDownWithError() async throws {