on(name, function(params))
: set up event
invoke(name, params)
: trigger event
clear(name)
: clear event(s)
yip.on('myEvent', function(){
console.log('myEvent called');
});
yip.invoke('myEvent');
yip.on('myEvent', function(param){
console.log(param);
});
yip.invoke('myEvent', 'foo');
yip.on('foo.bar', function(){
console.log('bar called');
});
yip.on('foo.rab', function(){
console.log('rab called');
});
yip.invoke('foo');
yip.clear() // clears all events
yip.clear('foo') // clears all events named foo (or events in foo namespace)
Running the following commands will build, execute tests, and deploy to a /build directory within the project root:
$ npm install
$ grunt
This project uses the Karma test runner. Karma allows us to easily run tests in any web browser and execute tests as files are updated.
$ npm install -g karma
$ karma start