I there a reason why methods in `interface Contain...
# kvision
t
I there a reason why methods in
interface Container
returns Container? I can't see any usecase where it could be useful and I don't think it's a good pattern (fluent interface). I think they should return
Unit
The only case I can imagine return something else is method add. It can return added component to support this shortcut:
Copy code
val mycomponent = add(MyComponent())
Right now this is possible
Copy code
SimplePanel().add(x).add(y).add(z)
But I think KVision should not allow it in favor of this:
Copy code
SimplePanel().apply {
    add(x)
    add(y)
    add(z)
}
r
I hardly ever use any of container methods directly myself ;-)
t
In the first case you can't be sure you are still working with the same instance.
r
You are probably right. Please fill an issue for KVision 6 🙂
t
Are you already working on version 6? I have bunch of ideas:)
r
No, I don't 🙂 But breaking changes are allowed in major releases only 😉
@Tomas Kormanak Now it's the right time for KVision 6 ideas 😉