React-Like programming for light-desk
Closed this issue · 0 comments
s0 commented
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.