Download:
child 13:32f98d0cd21b
parent 11:4232194a24ca
12:1a0314be2e82
Anton Shestakov <engored@ya.ru>, Fri, 04 Jan 2013 17:28:44 +0900
Use markdown for docs (syntax highlighting).

2 файлов изменено, 41 вставок(+), 39 удалений(-) [+]
README.md file | annotate | diff | comparison | revisions
README.rst file | annotate | diff | comparison | revisions
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/README.md Fri Jan 04 17:28:44 2013 +0900
@@ -0,0 +1,41 @@
+Overview
+========
+
+Backbone.Shard is a variation on a Subset taken from different perspective.
+Shard was built as a simple "persistent filter" for collections; it can
+help grouping and displaying items of certain kind based on your filter
+function. I know it works for me, but your mileage may vary.
+
+Usage
+=====
+
+It's easy if you're familiar with Backbone.Collection since Shard shares
+with it most of the methods marked **Underscore methods** in the
+[documentation](http://backbonejs.org/#Collection-Underscore-Methods):
+
+ :::javascript
+ var shelf = Backbone.Shard({
+ collection: books,
+ filter: function(book) { return book.get('read'); }
+ });
+
+ shelf.each(...);
+ shelf.pluck(...);
+
+You can add/remove models or reset *the original collection* and Shard will
+honestly try to keep up with it, but currently Shard itself has no methods
+such as add/remove/reset.
+
+Events work and respect your filter function:
+
+ :::javascript
+ shelf.on('add', doSomething);
+ collection.add({read true}); // this will call doSomething
+ collection.add({read: false}); // this won't
+
+Tests
+=====
+
+Download the
+[source](https://bitbucket.org/engored/backbone-shard/get/tip.tar.bz2) and
+open test/index.html in your browser.
--- a/README.rst Fri Dec 14 23:54:33 2012 +0900
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-Overview
-========
-
-Backbone.Shard is a variation on a Subset taken from different perspective.
-Shard was built as a simple "persistent filter" for collections; it can
-help grouping and displaying items of certain kind based on your filter
-function. I know it works for me, but your mileage may vary.
-
-Usage
-=====
-
-It's easy if you're familiar with Backbone.Collection since Shard shares
-with it most of the methods marked **Underscore methods** in the
-`documentation <http://backbonejs.org/#Collection-Underscore-Methods>`_::
-
- var shelf = Backbone.Shard({
- collection: books,
- filter: function(book) { return book.get('read'); }
- });
-
- shelf.each(...);
- shelf.pluck(...);
-
-You can add/remove models or reset *the original collection* and Shard will
-honestly try to keep up with it, but currently Shard itself has no methods
-such as add/remove/reset.
-
-Events work and respect your filter function::
-
- shelf.on('add', doSomething);
- collection.add({read true}); // this will call doSomething
- collection.add({read: false}); // this won't
-
-Tests
-=====
-
-Download the `source
-<https://bitbucket.org/engored/backbone-shard/get/tip.tar.bz2>`_ and open
-test/index.html in your browser.