Skip to content
A quick and dirty pub/sub thingamajig for the browser.
JavaScript CSS HTML
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
grunt-config
test
.gitignore
.travis.yml
Gruntfile.js
LICENSE
README.md
bower.json
package.json
shout.js

README.md

Shout.js

Build Status

Yet another pub/sub implementation.

To install via Bower

bower install shout

Usage

var vent = new Shout();
Shout.prototype.on( events, handler )
vent.on('whine', function( arg ) {
  console.log('enough with the' + arg + 'already');
});
Shout.prototype.emit( events[, arg1, arg2, ...] )
vent.emit('whine', 'Miley');
// 'enough with the Miley already'
Shout.prototype.off( events[, handler ] )
vent.off('whine');
Shout.prototype.once( events, handler )
vent.once('whine' function() {
  console.log('This callback will only fire once.');
});

To contribute

  • Get set up
sudo npm install -g grunt-cli
npm install
  • Run the lint/test suite
grunt
  • Submit a pull request!
Something went wrong with that request. Please try again.