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

React-Like programming for light-desk #174

Closed
s0 opened this issue Sep 23, 2023 · 0 comments · Fixed by #175
Closed

React-Like programming for light-desk #174

s0 opened this issue Sep 23, 2023 · 0 comments · Fixed by #175

Comments

@s0
Copy link
Member

s0 commented Sep 23, 2023

Rather than having lots of different modules / closures etc... that are maintaining state and listening to config changes, we could try to refactor the app to be a little more functional + declarative (perhaps taking inspiration from react hooks too), and being able to:

  • define a "tree" based on some input (i.e. config) that includes the functions and parameters to those functions
  • diff trees, and apply changes to create / remove light-desk components
  • have state hooks that can be used to determine when subtrees need to be updated

This is related to the work in #170, but would likely be a later evolution of it.

There is a chance that we may be able to use React itself, but with our own "engine", though this may be a bit tricky.

We should at the very least be able to use TSX with our own custom factory functions, see e.g: https://lwebapp.com/en/post/custom-jsx.

This would hopefully reduce the amount of state needed, and reduce the likelihood of state-based bugs.

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

Successfully merging a pull request may close this issue.

1 participant