Another Pub/Sub implementation
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.md adding examples to readme May 11, 2011
pubsubz.js added strict mode and getPubSubz decleration Jun 12, 2016
test.html

README.md

Just another compact library-agnostic Pub/Sub implementation.

Usage

	var testSubscriber = function( topics , data ){
	    console.log( topics + ": " + data );
	};

	var testSubscription = pubsubz.subscribe( 'example1', testSubscriber );

	pubsubz.publish( 'example1', 'hello world!' );
	pubsubz.publish( 'example1', ['test','a','b','c'] );
	pubsubz.publish( 'example1', [{'color':'blue'},{'text':'hello'}] );

	setTimeout(function(){
	    pubsubz.unsubscribe( testSubscription );
	}, 0);

	pubsubz.publish( 'example1', 'hello again!' );