Last active
August 29, 2015 14:18
-
-
Save natew/0c346ee04cfe3c06a216 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> |
Author
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
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.