Permalink
Browse files

Updated README.

  • Loading branch information...
1 parent b21e6cd commit 76007b8a946591bb6ce2e5f3f01c86dc4c4db551 @efeminella committed Aug 6, 2012
Showing with 14 additions and 14 deletions.
  1. +14 −14 README.md
View
@@ -1,5 +1,5 @@
## EventBroker API
-Provides a general purpose [Backbone](http://documentcloud.github.com/backbone/ "Title") Event Broker implementation based on the Backbone [Events API](http://documentcloud.github.com/backbone/#Events "Title"). The `EventBroker` can be used directly to serve as a centralized event management mechanism for an entire application. Additional namespaced brokers can also be created in order to provide context specific brokers within a particular part of an application.
+Provides a general purpose [Backbone](http://documentcloud.github.com/backbone/ "Title") Event Broker implementation based on the Backbone [Events API](http://documentcloud.github.com/backbone/#Events "Title"). The `EventBroker` can be used directly to serve as a centralized event management mechanism for an entire application. Namespaced brokers can also be created in order to provide context specific brokers within an application.
### Basic Usage
The `EventBroker` can be used directly to publish and subscribe to events of interest:
@@ -159,7 +159,7 @@ var CartView = Backbone.View.extend({
itemsBroker: Backbone.EventBroker.get('items'),
// Reference the 'inventory' EventBroker...
- inventoryBroker: Backbone.EventBroker.get('inventory'),
+ inventoryBroker: Backbone.EventBroker.get('inventory'),
initialize: function() {
// register events/callbacks with 'items' EventBroker...
@@ -190,9 +190,9 @@ To test if an `EventBroker` has been created for a given `namespace`, invoke the
``` javascript
// determines if an event broker for the given namespace exists
var EventBroker = Backbone.EventBroker;
-EventBroker.get( 'roles' ); // returns the 'roles' EventBroker
-EventBroker.has( 'roles' ); //true
-EventBroker.has( 'users' ); //false
+EventBroker.get('roles'); // returns the 'roles' EventBroker
+EventBroker.has('roles'); //true
+EventBroker.has('users'); //false
```
@@ -202,9 +202,9 @@ To destroy an existing `EventBroker` for a given `namespace`, invoke the `destro
``` javascript
// deletes the event broker for the given namespace
var EventBroker = Backbone.EventBroker;
-EventBroker.get( 'permissions' );
-EventBroker.destroy( 'permissions' ); // returns the 'permissions' EventBroker
-EventBroker.has( 'permissions' ); //false
+EventBroker.get('permissions');
+EventBroker.destroy('permissions'); // returns the 'permissions' EventBroker
+EventBroker.has('permissions'); //false
```
@@ -214,12 +214,12 @@ To destroy all existing `EventBrokers`, invoke the `destroy` method with no argu
``` javascript
// deletes the event broker for the given namespace
var EventBroker = Backbone.EventBroker;
-EventBroker.get( 'permissions' );
-EventBroker.get( 'users' );
-EventBroker.get( 'roles' );
+EventBroker.get('permissions'); // returns the 'permissions' EventBroker
+EventBroker.get('users'); // returns the 'users' EventBroker
+EventBroker.get('roles'); // returns the 'roles' EventBroker
EventBroker.destroy();
-EventBroker.has( 'permissions' ); //false
-EventBroker.has( 'users' ); //false
-EventBroker.has( 'roles' ); //false
+EventBroker.has('permissions' ); //false
+EventBroker.has('users'); //false
+EventBroker.has('roles'); //false
```

0 comments on commit 76007b8

Please sign in to comment.