Skip to content

Commit

Permalink
Fix misleading #bindEntitiyEvents docs
Browse files Browse the repository at this point in the history
  • Loading branch information
David Schäfer authored and samccone committed Jan 29, 2015
1 parent 49904d2 commit 2478c5d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
11 changes: 5 additions & 6 deletions docs/marionette.functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ Marionette.triggerMethodOn(ctx, "foo", bar);

## Marionette.bindEntityEvents

This method is used to bind a backbone "entity" (collection/model)
This method is used to bind a backbone "entity" (e.g. collection/model)
to methods on a target object.

```js
Expand All @@ -192,19 +192,18 @@ Backbone.View.extend({
});
```

The first parameter, `target`, must have a `listenTo` method from the
EventBinder object.
The first parameter, `target`, must have the Backbone.Events module mixed in.

The second parameter is the entity (Backbone.Model or Backbone.Collection)
to bind the events from.
The second parameter is the `entity` (Backbone.Model, Backbone.Collection or
any object that has Backbone.Events mixed in) to bind the events from.

The third parameter is a hash of { "event:name": "eventHandler" }
configuration. Multiple handlers can be separated by a space. A
function can be supplied instead of a string handler name.

## Marionette.unbindEntityEvents

This method can be used to unbind callbacks from entities' (collection/model) events. It's
This method can be used to unbind callbacks from entities' (e.g. collection/model) events. It's
the opposite of bindEntityEvents, described above. Consequently, the APIs are identical for each method.

```js
Expand Down
9 changes: 4 additions & 5 deletions src/bind-entity-events.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
// Bind Entity Events & Unbind Entity Events
// -----------------------------------------
//
// These methods are used to bind/unbind a backbone "entity" (collection/model)
// These methods are used to bind/unbind a backbone "entity" (e.g. collection/model)
// to methods on a target object.
//
// The first parameter, `target`, must have a `listenTo` method from the
// EventBinder object.
// The first parameter, `target`, must have the Backbone.Events module mixed in.
//
// The second parameter is the entity (Backbone.Model or Backbone.Collection)
// to bind the events from.
// The second parameter is the `entity` (Backbone.Model, Backbone.Collection or
// any object that has Backbone.Events mixed in) to bind the events from.
//
// The third parameter is a hash of { "event:name": "eventHandler" }
// configuration. Multiple handlers can be separated by a space. A
Expand Down

0 comments on commit 2478c5d

Please sign in to comment.