Nukem's Possible Manifestation

    @statflo/socket
    TypeScript icon, indicating that this package has built-in type declarations

    3.1.2 • Public • Published

    @statflo/socket

    A promised StompJS and SockJS class for managing subscriptions easily.

    Usage

    import SocketService from '@statflo/socket';
    
    const service = new SocketService('http://foo.bar/live', { connectHeader: 'foobar' }); // where { connectHeader } is an instance of Stomp.StompHeaders
    
    service.connect()
        .then(frame => {
            console.log(frame);
        })
        .catch(error => {
            console.error(error);
        });

    Subscription

    const exchange = service.subscribe('foo/bar', function(message) {
        console.log(message);
    });
    exchange.unsubscribe('foo/bar');

    Messaging

    service.message('foo/bar', 'Hello world!');

    License

    MIT Statflo Inc.

    Keywords

    none

    Install

    npm i @statflo/socket

    DownloadsWeekly Downloads

    23

    Version

    3.1.2

    License

    MIT

    Unpacked Size

    638 kB

    Total Files

    3

    Last publish

    Collaborators

    • dpham71
    • productlabs
    • alexeidarmin
    • dmstatflo
    • statflo-dev
    • statfloian