Skip to content

Commit

Permalink
Flesh out all current enumeration snippets in README; forEach snippet…
Browse files Browse the repository at this point in the history
… now generates 3-part function
  • Loading branch information
drnic committed Jun 5, 2011
1 parent 7d1fa60 commit e9e76b9
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
24 changes: 22 additions & 2 deletions README.md
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Snippets/filter.tmSnippet
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion Snippets/forEach(item).tmSnippet
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion Snippets/map.tmSnippet
Expand Up @@ -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>
Expand Down

0 comments on commit e9e76b9

Please sign in to comment.