3 ms·
<div data-query="each(products)"> ... </div> The React (or Mithril, or Mercury, or other virtual DOM libraries - just change the function being called) equival
by insin 11y ago
<div data-query="each(products)"> ... </div>
The React (or Mithril, or Mercury, or other virtual DOM libraries - just change the function being called) equivalent would be:
products.map(product => React.createElement('div', null, ... ))
Which you can use JSX (again in any virtual DOM library, via Babel) to sugar as:
products.map(product => <div> ... </div>)
The flow control is outside the DSL, not part of it.