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

Allow private validate and compute methods #2539

Closed
rodrigogiraoserrao opened this issue May 10, 2023 · 7 comments · Fixed by #2708
Closed

Allow private validate and compute methods #2539

rodrigogiraoserrao opened this issue May 10, 2023 · 7 comments · Fixed by #2708
Assignees
Labels
enhancement New feature or request question Further information is requested Task

Comments

@rodrigogiraoserrao
Copy link
Contributor

Following up on #2382 and #2442, and exactly for the same reasons, it also makes sense to allow for validate and compute methods to be private.
Can we implement this feature?

@rodrigogiraoserrao rodrigogiraoserrao added enhancement New feature or request question Further information is requested labels May 10, 2023
@willmcgugan
Copy link
Collaborator

I think this is implemented. Need to confirm.

@davep davep self-assigned this May 25, 2023
@davep
Copy link
Contributor

davep commented May 25, 2023

Grabbing to at least confirm (will look for tests and if none exist, add them).

@davep
Copy link
Contributor

davep commented May 25, 2023

Confirmed as not implemented.

@davep
Copy link
Contributor

davep commented May 25, 2023

While writing a couple of tests for this I did think of one wrinkle to this. watch can be public or private and if both methods exist both are called. That makes sense.

On the other hand, for validate and compute it's all about the return value. Supporting both existing could get confusing, perhaps?

@rodrigogiraoserrao
Copy link
Contributor Author

For validate, I wouldn't be surprised if we had new_value -> private validate -> public validate.
For compute, I'd raise an error saying you can't have two?

@davep
Copy link
Contributor

davep commented May 25, 2023

@rodrigogiraoserrao Aye, I like that flow for validate; that makes sense to me.

@github-actions
Copy link

github-actions bot commented Jun 6, 2023

Don't forget to star the repository!

Follow @textualizeio for Textual updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested Task
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants