Permalink
Browse files

Flesh out all current enumeration snippets in README; forEach snippet…

… now generates 3-part function
  • Loading branch information...
drnic committed Jun 5, 2011
1 parent 7d1fa60 commit e9e76b949bd5341545923d64f86af96b73cf11d7
Showing with 25 additions and 5 deletions.
  1. +22 −2 README.md
  2. +1 −1 Snippets/filter.tmSnippet
  3. +1 −1 Snippets/forEach(item).tmSnippet
  4. +1 −1 Snippets/map.tmSnippet
View
@@ -82,14 +82,34 @@ Various parts are quickly deletable (`@each`, `'secondary'`, `cacheable()`).
### forEach
-`fore` expands to the `forEach` helper iterating over an `item` object:
+`.fore` expands to the `forEach` helper iterating over an `item` object:
``` javascript
-forEach(function(item) {
+.forEach(function(item, index, self) {
item
});
```
+### map
+
+`.map` expands to the `map` helper iterating over an `item` object:
+
+``` javascript
+.map(function(item, index, self) {
+ return item;
+});
+```
+
+### filter
+
+`.fil` expands to the `filter` helper iterating over an `item` object:
+
+``` javascript
+.filter(function(item, index, self) {
+ return item;
+});
+```
+
## Controller subclasses
### SC.ArrayController
@@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>content</key>
- <string>.filter(function(${1:item}, index, self) {
+ <string>.filter(function(${1:item}${2:, index${5:, self}}) {
return $1$0;
});</string>
<key>name</key>
@@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>content</key>
- <string>.forEach(function(${1:item}) {
+ <string>.forEach(function(${1:item}${2:, index${5:, self}}) {
$1$0
});</string>
<key>name</key>
View
@@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>content</key>
- <string>.map(function(${1:item}, index, self) {
+ <string>.map(function(${1:item}${2:, index${5:, self}}) {
return $1$0;
});</string>
<key>name</key>

0 comments on commit e9e76b9

Please sign in to comment.