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
docs(examples): simplify the barchart example #1079
base: main
Are you sure you want to change the base?
Conversation
joshka
commented
May 2, 2024
- Simplify the rendering functions
- Fix several clippy lints that were marked as allowed
- Extract a common.rs for terminal initialization and error handling
- Simplify the rendering functions - Fix several clippy lints that were marked as allowed - Extract a common.rs for terminal initialization and error handling
I made a bunch of changes:
|
The idea behind this is to do similar changes to all the examples, and to make them take this form. |
Move constants closer to their usage add an exit field to app extract methods from the main loop to make the flow clearer move update handling to use a field on app instead of a variable in the loop rename last_tick to last_update to make it clearer what it controls
fix: tweaks
|
Given that there are other Repos with widget examples… how about a ratatui feature for an example base? Other widgets in other repos can also use them as a common base to demonstrate their widgets then. |
An example is just an app. |
This creates a common example base. My point is to make this |
I think it might be better to incorporate that file in each example instead as it makes each example self contained as a single file. Publishing public code locks you into supporting it and not making changes that would break code that uses it. I'd prefer this code to be copied instead of referenced. |