Skip to content

Instantly share code, notes, and snippets.

@Kaaveh
Created September 26, 2023 06:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kaaveh/2f50ee03a0bb086d9f77109d51dda198 to your computer and use it in GitHub Desktop.
Save Kaaveh/2f50ee03a0bb086d9f77109d51dda198 to your computer and use it in GitHub Desktop.
import ir.composenews.domain.model.Market
data class MarketModel(
val id: String,
val name: String,
val currentPrice: Double,
val imageUrl: String,
val isFavorite: Boolean = false,
)
fun MarketModel.toMarket() = Market(
id = id,
name = name,
currentPrice = currentPrice,
imageUrl = imageUrl,
isFavorite = isFavorite,
)
fun Market.toMarketModel() = MarketModel(
id = id,
name = name,
currentPrice = currentPrice,
imageUrl = imageUrl,
isFavorite = isFavorite,
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment