Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

shift => unshift

  • Loading branch information...
commit 53a1f2c2fcf387e8638ae3eaa564bce04f0896fa 1 parent 8a15048
Matthew Mueller authored November 11, 2012

Showing 2 changed files with 12 additions and 2 deletions. Show diff stats Hide diff stats

  1. 12  Readme.md
  2. 2  list.js
12  Readme.md
Source Rendered
@@ -100,7 +100,17 @@ Add a template `fn` to be used when adding items.
100 100
 
101 101
 ### List#add(arr | obj, [fn])
102 102
 
103  
-Add new list item(s). Pass each `obj` into the templating function. When `selected` the optional callback `fn` will be invoked.
  103
+Add a new list item. Pass each `obj` into the templating function. When `selected` the optional callback `fn` will be invoked.
  104
+
  105
+```js
  106
+list.add({ name : 'apple' }, function(item) {
  107
+  console.log('You selected:', item.name);
  108
+})
  109
+```
  110
+
  111
+### List#unshift(arr | obj, [fn])
  112
+
  113
+Add a new list item to the front of the list. Pass each `obj` into the templating function. When `selected` the optional callback `fn` will be invoked.
104 114
 
105 115
 ```js
106 116
 list.add({ name : 'apple' }, function(item) {
2  list.js
@@ -102,7 +102,7 @@ List.prototype.add = function(obj, fn, _action) {
102 102
  * @api public
103 103
  */
104 104
 
105  
-List.prototype.shift = function(obj, fn) {
  105
+List.prototype.unshift = function(obj, fn) {
106 106
   return this.add(obj, fn, 'prependTo');
107 107
 };
108 108
 

0 notes on commit 53a1f2c

Please sign in to comment.
Something went wrong with that request. Please try again.