0.9.6 • Published 4 years ago

@pubsub-a/micro v0.9.6

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

PubSub/A Reference Implementation

This is the reference implementation of the PubSub/A interface proposal. The implementation is written in TypeScript but can be consumed from any JavaScript code.

While PubSub/A is designed to work over the network, this reference implementation only works locally. Subscriptions are only share among the same instance of the PubSubMicro instance.

import { PubSubMicro as PubSub } from "@pubsub-a/micro"

const pubsub = new PubSub();
pubsub.start()
    .then(function() {
        return pubsub.channel('myChannel');
    }).then(function(channel) {
        channel.subscribe('myTopic', function(arg) {
            console.log('received arg: ', arg);
        });
        channel.publish('myTopic', { foo: 'bar' });
    });
});

See the PubSub/A interface definition for in-depth syntax overview.

0.9.6

4 years ago

0.9.4

4 years ago

0.9.5

4 years ago

0.9.3

4 years ago

0.9.2

4 years ago

0.9.1

4 years ago

0.9.0

4 years ago