Skip to content

Commit

Permalink
Mark appropriate classes as @stable or @immutable (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidliu committed Mar 28, 2024
1 parent e96d599 commit 2fdd06b
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,4 @@ fun rememberChat(room: Room = RoomLocal.current): Chat {

private val json = Json {
ignoreUnknownKeys = true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package io.livekit.android.compose.flow

import androidx.compose.runtime.Composable
import androidx.compose.runtime.Stable
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
Expand All @@ -36,6 +37,7 @@ data class DataSendOptions(val reliability: DataPublishReliability, val identiti
*
* @see rememberDataMessageHandler
*/
@Stable
class DataHandler(
/** A flow for all the [DataMessage] received. */
val messageFlow: Flow<DataMessage>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package io.livekit.android.compose.state

import androidx.compose.runtime.Composable
import androidx.compose.runtime.Immutable
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.remember
import io.livekit.android.compose.local.requireParticipant
Expand All @@ -26,6 +27,7 @@ import io.livekit.android.util.flow
/**
* Holder for basic [Participant] information.
*/
@Immutable
data class ParticipantInfo(
val name: String?,
val identity: Participant.Identity?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package io.livekit.android.compose.state

import androidx.compose.runtime.Composable
import androidx.compose.runtime.Immutable
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.remember
import io.livekit.android.compose.local.requireRoom
Expand All @@ -26,6 +27,7 @@ import io.livekit.android.util.flow
/**
* Holder for basic [Room] information.
*/
@Immutable
data class RoomInfo(
val name: String?,
val metadata: String?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import androidx.compose.material3.ExposedDropdownMenuDefaults
import androidx.compose.material3.Text
import androidx.compose.material3.TextField
import androidx.compose.runtime.Composable
import androidx.compose.runtime.Immutable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.MutableState
import androidx.compose.runtime.getValue
Expand All @@ -34,6 +35,7 @@ import androidx.compose.ui.platform.LocalContext
import livekit.org.webrtc.Camera1Enumerator
import livekit.org.webrtc.Camera2Enumerator

@Immutable
data class DeviceState(val selectedDeviceId: String, val deviceIds: List<String>)

/**
Expand Down

0 comments on commit 2fdd06b

Please sign in to comment.