mbrandonw
01/27/2020, 9:14 PM@optics
sealed class SearchFieldEvent {
@optics
data class QueryChanged(val query: String) : SearchFieldEvent() {
companion object
}
companion object
}
Then the generated optics of reaching down to the query string like this:
SearchFieldEvent.queryChanged.query
produces an Optional even though it could be a Prism. I know in general it can’t be a prism (e.g. if QueryChange has multiple fields), but it’s pretty common to have this use case of a single field in the inner class.
Is there a supported way to get access to this prism more easily than manually composing the optics like this:
SearchFieldEvent.queryChanged compose QueryChanged.iso
?