Skip to content

Commit 2d0b4ef

Browse files
committed
refactor
1 parent d88844e commit 2d0b4ef

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

feature-main/src/main/java/com/hoc/flowmvi/ui/main/MainContract.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.hoc.flowmvi.ui.main
22

3+
import androidx.annotation.MainThread
34
import androidx.compose.runtime.Immutable
45
import arrow.core.Either
56
import com.hoc.flowmvi.domain.model.User
@@ -11,6 +12,7 @@ import kotlinx.collections.immutable.PersistentList
1112
import kotlinx.collections.immutable.mutate
1213
import kotlinx.collections.immutable.persistentListOf
1314
import kotlinx.collections.immutable.toPersistentList
15+
import kotlin.LazyThreadSafetyMode.NONE
1416

1517
@Immutable
1618
data class UserItem(
@@ -21,7 +23,8 @@ data class UserItem(
2123
val lastName: String,
2224
val isDeleting: Boolean
2325
) {
24-
val fullName get() = "$firstName $lastName"
26+
@get:MainThread
27+
val fullName by lazy(NONE) { "$firstName $lastName" }
2528

2629
constructor(domain: User) : this(
2730
id = domain.id,

0 commit comments

Comments
 (0)