History: My modules are hierarchical, but callbacks are orthogonal.
- View SourceI need to store several variables pertaining to the current state. In particular, they'd represent "current category of interest; current tab within that category; current page within that tab; current selection". The cleanest and most user-parseable representation of that would be
but I can't go about registering "category", "tab", and "page" as modules, since the order of callbacks is undefined, and I really need to know all of them at once in order to render the view.
Of course, I can devise my own scheme for representing the hierarchy, such as
but it would be a shame to lose the ready-made semantics we have in the other syntax.
In my opinion, it wouldn't be too difficult to support a mode of operation that, instead of looping through the various modules and calling discrete callbacks (which works for orthogonal state), you'd collate the various state variables into an object and send it all at once to a single callback.
What do you think?