We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
LVGL already has subject/objserver available, but it's in a poor state:
lvgl/src/others/observer/lv_observer.c
We can use lua for the same idea. Example of usage.
local subjectA = Subject() local subjectB = Subject() local obj = Object() obj.w = subjectA obj.h = Subject({subjectA, subjectB}, calculate = function(subjects) return subjects[0] + subjects[1] end ) subjectA.value = 123
Under the hood, we monitor the value of a property set to obj in obj.__newindex meta method, bind the property to a subject.
obj.__newindex
Also monitor subject.__newindex meta method, call the obj.set method with subject's actual value.
obj.set
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Introduce the problem
LVGL already has subject/objserver available, but it's in a poor state:
lvgl/src/others/observer/lv_observer.c
Proposal
We can use lua for the same idea.
Example of usage.
Under the hood, we monitor the value of a property set to obj in
obj.__newindex
meta method, bind the property to a subject.Also monitor subject.__newindex meta method, call the
obj.set
method with subject's actual value.The text was updated successfully, but these errors were encountered: