Skip to content

Commit

Permalink
Make event handlers chainable.
Browse files Browse the repository at this point in the history
  • Loading branch information
oesmith committed May 10, 2013
1 parent e5c856f commit feca1ec
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions lib/morris.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class Morris.EventEmitter
unless @handlers[name]?
@handlers[name] = []
@handlers[name].push(handler)
@

fire: (name, args...) ->
if @handlers? and @handlers[name]?
Expand Down
5 changes: 3 additions & 2 deletions morris.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit feca1ec

Please sign in to comment.