mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 21:32:34 +00:00
Enforce no default value in state.
This commit is contained in:
committed by
Benoit Marty
parent
a77479ed05
commit
0f0c001c3c
+6
-1
@@ -17,6 +17,11 @@
|
||||
package io.element.android.features.template
|
||||
|
||||
// TODO add your ui models. Remove the eventSink if you don't have events.
|
||||
// Do not use default value, so no member get forgotten in the presenters.
|
||||
data class TemplateState(
|
||||
val eventSink: (TemplateEvents) -> Unit = {}
|
||||
val eventSink: (TemplateEvents) -> Unit
|
||||
)
|
||||
|
||||
fun aTemplateState() = TemplateState(
|
||||
eventSink = {}
|
||||
)
|
||||
|
||||
+1
-1
@@ -50,6 +50,6 @@ fun TemplateViewDarkPreview() = ElementPreviewDark { ContentToPreview() }
|
||||
@Composable
|
||||
private fun ContentToPreview() {
|
||||
TemplateView(
|
||||
state = TemplateState(),
|
||||
state = aTemplateState(),
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user