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

DirtyValue: add possibility to mark DirtyValue updated #2207

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ljahn
Copy link
Contributor

@ljahn ljahn commented Dec 23, 2024

Adds the ability to manually mark a DirtyValue as updated.

This simplifies situations where a the user (or any other condition) selects if a value should be updated.

Example: In my Star Trek watch face I give the possibility to show weather or not. Using this function, I do not have to duplicate the weather updating code to the button press handler or introduce another variable weatherNeedsUpdate. I can just make the corresponding element visible, mark the weather data as updated (although it really isn't), and the next normal refresh loop will put the correct weather information.

Copy link

Build size and comparison to main:

Section Size Difference
text 372816B 0B
data 948B 0B
bss 22536B 0B

@ljahn ljahn mentioned this pull request Dec 23, 2024
@mark9064 mark9064 added the maintenance Background work label Feb 9, 2025
@mark9064
Copy link
Member

I don't love this conceptually as it kind of breaks the idea that the DirtyValue is a state container that informs of updates only on state changes. However, I'm not dead set on not including this

For your use-case, could you update the weather irrespective of whether it's visible or not?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Background work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants