-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat: Added two more options to setvar. #3654
base: main
Are you sure you want to change the base?
Conversation
Either provide a dot-separated string to access fields on objects or use a var to describe which value to set.
when i initially implemented consider the following code rx.input(value=State.message, on_change=State.setvar(State.message)) it's not clear if i'm intending to set |
I still like "the |
This is actually on the horizon. We're working on the Var refactor now and descriptor-based state Vars are part of that project. |
OK, I see. Sorry that I didn't do the history digging 👍 Thanks! |
to be clear, i still think |
Ah, sorry, tiny misunderstanding 😄 , so we are still in the game 🎲 . With your suggested change we can still write something like the following, which can help when refactoring, but typing is a bit 💔, but of course we can use a little rx.input(
value=State.object.name, on_change=State.setvar(State.object.name._var_name)
) @benedikt-bartscher Do you think this could still help then with our wild internal meta-programming dreams? Or to help the confused API-users, we rename the function from |
Marking this as draft until resynced with main. |
Either provide a dot-separated string to access
fields on objects or use a var to describe which
value to set.
This enables you to write something like this:
It might need some polishing with regard to nonexisting fields on objects, which is not checked for now.
But I want to share a first version to get feedback.