Skip to content

Commit

Permalink
Update all checks to use assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshuawuyts committed May 31, 2014
1 parent bd7e7f0 commit 1324640
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ function Dispatcher() {
*/

dispatcher.register = function(action, callback) {
assert('string' == typeof action, 'dispatcher.register: provide a string as argument.');

assert('string' == typeof action, 'dispatcher.register: action must be a string');
assert('function' == typeof callback, 'dispatcher.register: callback must be a function');

if (!this.callbacks[action]) this.callbacks[action] = [];
this.callbacks[action].push(callback);
};
Expand Down

0 comments on commit 1324640

Please sign in to comment.