https://kotlinlang.org logo
l

Leland Richardson [G]

06/29/2019, 5:49 PM
though there are still a few advantages of class components that we are trying to work out
s

simon.vergauwen

06/30/2019, 4:55 PM
Could you elaborate on this? I'm curious what you can do with classes that you currently can't do with functions from a public API pov.
👍 1
l

Leland Richardson [G]

07/01/2019, 12:29 AM
the biggest thing from my point of view right now is around the overloading of properties/parameters, and other types of overloading as well. For instance, with a class component, you can have a property like
var foo: String
but then have an additional overload with an extension property or something else like
var foo: Int
, allowing both an
Int
and a
String
to be used to configure
foo
. This can be a useful pattern but it’s hard to represent in functions without a type system that allows for union types. But the ability to define some extension-property based properties to all components was useful but perhaps not critical. Additionally, component classes offered some interesting patterns around overloaded compose functions (which we modeled as invoke operators), but I’m less convinced on the usefulness of that over what you get with functions (normal overloading capabilities)
👍 1
s

simon.vergauwen

07/01/2019, 7:25 AM
That makes sense. Thanks for the follow up 🙂