Thread
#compose
    Zsolt

    Zsolt

    2 years ago
    Just noticed that changing a var in a @Model annotated class constructor doesn't trigger recomposition, only if the var is declared in the class body.
    l

    Leland Richardson [G]

    2 years ago
    can you provide an example?
    Zsolt

    Zsolt

    2 years ago
    @Model
    class Foo(private var bar: Int) {
    
    }
    
    // vs:
    
    @Model
    class Foo {
        private var bar: Int
    }
    l

    Leland Richardson [G]

    2 years ago
    Really? I was definitely under the impression that that worked
    Zsolt

    Zsolt

    2 years ago
    That was the only difference at the time I wrote, and rolled it back and forth a couple of times. Worked one way, didn't work the other. I moved on with the working version and now I can no longer reproduce it and it feels stupid.
    l

    Leland Richardson [G]

    2 years ago
    note that one issue that we are aware of is @Model is not doing anything on inner/nested classes
    which is just a bug
    but it gets ppl a lot
    that could have been what you were seeing