#435 showed its possible to write an HoA to encapsulate state+action+view into module and #435 (comment) showed its possible to load lazy said module, except for the module actions.
Motivation
Code splitting.
Problem
There is currently no way to add actions dynamically.
Possible Solutions
1. Include addAction action in app
- solves the problem in the most direct way
2. Include loadModule action in app
- solves the bigger issue at the same time
3. Merge the concepts of state and actions
- state is expected to change, so what if we just put state and actions in the same place?
- replace
state and actions with root, keep view
- allow
root to hold both data and functions. functions would take in root and slice the tree as it does now
- functions return and object which will merge into the subtree of where it lives, it can return both data and more functions (aka actions!)
- since actions don't need to be there at init time, then modules don't need to exist either! modules can be put directly on the root or added during init or add lazily later
Option 3 is most interesting to me since it removes even more concepts from Hyperapp.
#435 showed its possible to write an HoA to encapsulate state+action+view into module and #435 (comment) showed its possible to load lazy said module, except for the module actions.
Motivation
Code splitting.
Problem
There is currently no way to add actions dynamically.
Possible Solutions
1. Include
addActionaction in app2. Include
loadModuleaction in app3. Merge the concepts of
stateandactionsstateandactionswithroot, keepviewrootto hold both data and functions. functions would take in root and slice the tree as it does nowOption 3 is most interesting to me since it removes even more concepts from Hyperapp.