Permalink
Switch branches/tags
Nothing to show
Find file Copy path
2193463 Mar 22, 2011
1 contributor

Users who have contributed to this file

30 lines (29 sloc) 604 Bytes
<!DOCTYPE html>
<html>
<head></head>
<body>
<script src="../microevent.js"></script>
<script>
/**
* Ticker is a class periodically sending out dummy tick events
*/
var Ticker = function( interval ){
var self = this;
setInterval(function(){
self.trigger('tick', new Date());
}, 500);
};
/**
* make Ticker support MicroEventjs
*/
MicroEvent.mixin(Ticker);
// create a ticker
var ticker = new Ticker();
// bind the 'tick' event
ticker.bind('tick', function(date) {
// display to check
console.log('notified data'+ date);
});
</script>
</body>
</html>