Skip to content

Instantly share code, notes, and snippets.

@natew
Last active August 29, 2015 14:18
Show Gist options
  • Save natew/0c346ee04cfe3c06a216 to your computer and use it in GitHub Desktop.
Save natew/0c346ee04cfe3c06a216 to your computer and use it in GitHub Desktop.
Book
author <- #authors(data.authorId).name
<div.book>
<img src={data.source}>
<div.title>{data.title}</div>
{showAuthor? <div.author>by {author}</div>}
</div>
Main
limit = 5
showAuthors = true
books? <- #books.sortBy(.title).take(limit)
<div.main>
<p>Limit: <input sync={limit}></p>
<p>Show Authors: <input type="checkbox" sync={showAuthors}></p>
--books? books.map:
<Book data={book} showAuthor={showAuthors} />
--else
<div>loading</div>
</div>
@natew
Copy link
Author

natew commented Apr 4, 2015

I almost think though its more verbose just doing <div class="main"> still would be more attractive to newcomers, because it keeps the html syntax.

@ncammarata
Copy link

I like the idea of div.main, it's clear. div class="main" can also work, but it seems objectively worse. I think both working would be good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment