Pure Functions - Deterministic

data class ChatMessage(
    val user: String
    val timestamp: Instant
    val message: String) 


fun newMessage(message: String, user: String, timestamp: Instant) : ChatMessage { 
  return ChatMessage(
    user = user,
    timestamp = timestamp,
    message = message)
}

Back Home Next