Adding structure to top-level AsyncGenerator variables? #885
-
I have a number of input variables that repeat across categories. I was trying to group those into JS objects to allow them to be passed more easily to a function. const stationOccupancyV = view(Inputs.range([0,100]))
const station = {
"stationOccupancy": stationOccupancyV,
} stationOccupancyV yields: station.stationOccupancy yields:
I could use a prefix to get a unique name for each top level variable, but that would result in repetitive code as things become more complex. Is there a more elegant way to work with these async generators within a data structure that retains the behavior of the top-level variables? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
A way could be Inputs.form which allows to combine several inputs into one: https://github.com/observablehq/inputs#inputsforminputs-options |
Beta Was this translation helpful? Give feedback.
A way could be Inputs.form which allows to combine several inputs into one: https://github.com/observablehq/inputs#inputsforminputs-options