0.2.5 • Published 12 years ago

bazaar v0.2.5

Weekly downloads
4
License
-
Repository
-
Last release
12 years ago

Bazaar

Description: A publish-subscribe (broadcast-listen) layer for same-origin inter-window communication. Let's you broadcast messages to all opened windows, which are listening.

Home page: jakut.is/git/BAZAAR/about

npm package: bazaar

jam package: bazaar

License: MIT

Author: Vytautas Jakutis

Example usage

demo code

// '/bazaar-worker.js' specifies the url of worker script
// 'hub1' specifies the namespace, this argument is optional, default is '__bazaar__'
var hub = window.bazaar('/bazaar-worker.js', 'hub1');

if(hub === null) {
    alert('your web browser is not supported');
} else {
    document.onmousedown = function() {
        hub.broadcast(new Date().getTime());
    };
    hub.listen(function(err, ts) {
        if(err) {
            return alert("An error occurred when receiving a message.");
        }
        alert(ts);
    });
}

Supported browsers

  • Mozilla Firefox 2.0+
  • Opera 10.50+
  • Google Chrome 5+
  • Microsoft Internet Explorer 6+
  • Apple Safari 4.0+
0.2.5

12 years ago

0.2.4

12 years ago

0.2.3

12 years ago

0.2.2

12 years ago

0.2.1

13 years ago

0.2.0

13 years ago

0.1.0

13 years ago

0.0.7

13 years ago

0.0.6

13 years ago

0.0.5

13 years ago

0.0.4

13 years ago

0.0.3

13 years ago

0.0.2

13 years ago

0.0.1

13 years ago