Skip to content

Instantly share code, notes, and snippets.

@Quby
Created August 5, 2012 15:43
Show Gist options
  • Save Quby/3265510 to your computer and use it in GitHub Desktop.
Save Quby/3265510 to your computer and use it in GitHub Desktop.
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);
}
});
}
}
{{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