Paul Meshkovsky
10/28/2024, 4:45 PMcommonMain
however specific functions that are trivial to that Enum should be supported across all (at least I know these are applicable to Kotlin JS) ex
enum class SampleEnum (
val category: String,
val description: String
) {
A_ONE("A", "Some Desc A One"),
A_TWO("A", "Some Desc A Two"),
B_ONE("B", "Some Desc B One"),
B_TWO("B", "Some Desc B Two");
companion object {
fun getAllPerCategoryA() = entries.filter( it.category == "A")
}
}
I see that "filter" is not supported in commonMain. And approach to create this in each source code defeats the purpose of common codebase. Is there a way to make JVM and JS Common since each one support this functionality?Jason
10/29/2024, 4:22 PMentries.filter { it.category == "A" }