Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Private fields and no getters for table.Column #157

Closed
prgres opened this issue Nov 22, 2023 · 5 comments
Closed

Private fields and no getters for table.Column #157

prgres opened this issue Nov 22, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@prgres
Copy link
Contributor

prgres commented Nov 22, 2023

Is there any specific reason why all fields are private/don't have getters? I would need to have access to the 'key' property and do not know if I should prepare a PR :)

@Evertras
Copy link
Owner

Evertras commented Nov 22, 2023

To clarify, you mean the key property of Column? Sorry I apparently can't read titles... whoops.

Everything is unexported to avoid any modifications that would break the flow of Bubble Tea; everything must be immutable. I'm not against adding a read-only getter for Column.key in particular, if that would be useful to you.

More out of curiosity than any need for justification, but why did you want to access the key after creating this? I think the usual use case is a set of constant keys, so there doesn't seem to be much need to get the key back out.

@Evertras Evertras added the enhancement New feature or request label Nov 22, 2023
@prgres
Copy link
Contributor Author

prgres commented Nov 22, 2023

Sorry, I am not the best at writing self-describing titles :D

I cannot make constants with column keys because I am not aware of them during build time. I am fetching data from the external API and creating a table on the fly. Currently, I did a workaround with storing columnsKeys as a separate field in my struct but it would be desirable to get them directly from the table.

Okay, I will prepare a PR soon then

@Evertras
Copy link
Owner

Got it... sounds good then, should be pretty straightforward! I'll keep an eye out for PR.

@prgres
Copy link
Contributor Author

prgres commented Nov 23, 2023

#158

@Evertras
Copy link
Owner

Released as v0.15.5

@prgres prgres closed this as completed Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants