Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

    <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.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: