l

    Leland Richardson [G]

    3 years ago
    though there are still a few advantages of class components that we are trying to work out
    simon.vergauwen

    simon.vergauwen

    3 years ago
    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.
    l

    Leland Richardson [G]

    3 years ago
    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)
    simon.vergauwen

    simon.vergauwen

    3 years ago
    That makes sense. Thanks for the follow up 🙂