Repository navigation
Replies: 1 comment 1 reply
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi! Why passing/storing child models by references isn't a standart in Bubble Tea?
Now of course I can have references, but it doesn't make much sense while internal methods don't use pointer receivers (
list.Update()for ex.), and vice versa it adds a lot of ugly cause models are not intended to be used by references,New()for ex. return value.Using references leads to simplicity - now we should always update value of model, have separate field to indicate that it's active, but just with pointer receiver we will be able to do this in
main.Update():Models often is big (
list.Modelis big enough), so there is also a performance reason. And in the end, interfaces in Go love references, interface is reference, passing a value to interface results in another copy, where Go store value internally and anyway takes reference to it for interface value.So, isn't changing this standard a good idea for the Bubble Tea v2, or is there some reason that I don't understand why this's done in that way?
All reactions