2012-04-21 04:56:40 +00:00
|
|
|
module.exports = function ( target, searchChannel, statsChannel ) {
|
2012-04-18 05:05:32 +00:00
|
|
|
target.bus = {
|
2012-04-21 04:56:40 +00:00
|
|
|
subscriptions : [],
|
|
|
|
|
publishers : [
|
|
|
|
|
target.on( "newTweets", function ( data ) {
|
|
|
|
|
statsChannel.publish( { topic : "newTweets", data : data } );
|
2012-04-18 05:05:32 +00:00
|
|
|
} ),
|
2012-04-21 04:56:40 +00:00
|
|
|
target.on( "search.current", function ( data ) {
|
|
|
|
|
searchChannel.publish( { topic : "search.current", data : data } );
|
2012-04-18 05:05:32 +00:00
|
|
|
} ),
|
2012-04-21 04:56:40 +00:00
|
|
|
target.on( "search.nodata", function ( data ) {
|
|
|
|
|
searchChannel.publish( { topic : "search.nodata", data : data } );
|
|
|
|
|
} ),
|
|
|
|
|
target.on( "search.init", function ( data ) {
|
|
|
|
|
searchChannel.publish( { topic : "search.init", data : data } );
|
2012-04-18 05:05:32 +00:00
|
|
|
} )
|
|
|
|
|
]
|
|
|
|
|
};
|
|
|
|
|
return target;
|
|
|
|
|
};
|