Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshuawuyts committed May 28, 2014
1 parent d7ea5a2 commit d5270c4
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,18 @@
An event dispatcher for the [flux architecture](http://facebook.github.io/react/blog/2014/05/06/flux.html).

## API
__Initialize a dispatcher:__
````js
// Initialize a dispatcher
var Dispatcher = require('barracks');
var dispatcher = Dispatcher();
````

__Register a new object:__
````js
var callbackFunction = function(arg) {/*side effect goes here*/};

// Register a new object:
var callbackFunction = function(arg) {
/*side effect goes here*/
};
dispatcher.register('eventName', callbackFunction);
````

__Dispatch the registered callbacks:__
````js
// Dispatch registered callbacks for 'eventName'
dispatcher.dispatch('eventName');
````

Expand Down

0 comments on commit d5270c4

Please sign in to comment.