Created
August 5, 2012 15:43
-
-
Save Quby/3265510 to your computer and use it in GitHub Desktop.
This file contains 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
function content() { | |
for (var $2 in books) { | |
book = books[$2] | |
$cache["books-view"].get(book.id, function (data) { | |
if (data === null) { | |
$0 = new Buffer() | |
$1 = $res; | |
$res = $0; | |
$pull[books].get(book.id, function (book) { | |
$res.write("<h1>"); | |
$res.write(book.title); | |
$res.write("</h1><p>"); | |
$res.write(book.description); | |
$res.write("</p><h1>gm</h1>"); | |
}); | |
$res = $1; | |
$res.write($0); | |
} else { | |
$res.write(data); | |
} | |
}); | |
} | |
} |
This file contains 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
{{def content}} | |
{{each book in books}} | |
{{cache books-view book.id}} | |
{{pull books book.id book}} | |
<h1>{{book.title}}</h1> | |
<p>{{book.description}}</p> | |
{{/}} | |
{{/}} | |
{{/}} | |
{{/}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment