Naming for NiceGUI's new React-like API #1489
Closed
falkoschindler
started this conversation in
Polls
Replies: 3 comments
-
I think option 4 is most intuitive when combined with the team's format of documentation (with an example for clarity/practicability). |
Beta Was this translation helpful? Give feedback.
0 replies
-
Option 2 simple, easy to use |
Beta Was this translation helpful? Give feedback.
0 replies
-
Ok, thanks everyone for taking part in this survey! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In PRs #1438 and #1447 we're developing a new API for writing reactive UI functions that behave similar to React:
When using
set_count()
inside the click handler, the UI is automatically updated.In PR #1447 we found a rather lightweight implementation based on
ui.refreshable
, so that you can also callcounter.refresh
programmatically. From this point of viewui.reactive
andui.refreshable
are very similar, suggesting to use the nameui.refreshable
even for reactive functions withuse_state()
. But this might confuse React users and doesn't perfectly indicate the reactive behavior.So my question is: How should the API for auto-refreshing UI functions be?
ui.refreshable
, no reactWe would keep NiceGUI as it is and don't add the new reactive behavior, basically to keep things simple.
ui.refreshable
,ui.state
We extend the existing
ui.refreshable
to support the newui.state
(without theuse_
prefix from the example above).ui.xxx
,ui.yyy
(option 2 with different names)We extend the existing
ui.refreshable
to support "UI state", but give different names. Please comment with your suggestion.ui.refreshable
+ui.reactive
/ui.use_state
We keep
ui.refreshable
unchanged and introduce reactive functions namedui.reactive
andui.use_state
to stay close to React.What do you think? Do you have additional thoughts and ideas?
22 votes ·
Beta Was this translation helpful? Give feedback.
All reactions